Tagged Questions
Java (not to be confused with JavaScript or JScript) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java programs. ...
0
votes
0answers
4 views
Error accessing field [xxxx] by reflection for persistent property
I am getting the following error when I hit an endpoint with Error , I have 2 classes where one is a Entity and the other is a view.
It is giving error when Entity is being converted to view
Error ...
0
votes
1answer
10 views
Is it possible to use entity classes and EntityManager without a server?
In school we learn about jpa. A great method to get and add data to an database. I´m currently on an smal project and do not actually need to build an ebj and a client with Payara/glasfish.. But I ...
0
votes
0answers
6 views
How to read ::after attributes of a radio button element using Selenium WebDriver
I have been trying to read the content inside an html tag which has features like ::before and ::after using selenium webdriver (Java), but I'm having hard time to read those contents since they are ...
0
votes
3answers
23 views
most efficient way calling a specific method by key
I have algorithm that give me an Integer.
Based on this Integer, i want to call a method.
Every Integer is unique (like a primary key in a database) and has 1 method to call. Every method returns ...
0
votes
0answers
3 views
Java ECLIPSE Nearest TSP with Nearest Neighbour Algorithm
First question I ask here on the forum, had some use on many questions posted here. I am stuck with my current assignment: I need to make a TSP with a nearest neighbour algorithm and then store the ...
0
votes
0answers
6 views
java jdbc connection pool & distributed transactions ?
I just have read docs.oracle.com/javase/tutorial/jdbc/basics. Is it posible to use jdbc connection pool & distributed transactions together, if yes, how? Where I read about this? What the best way ...
0
votes
1answer
11 views
How to mock constructor with PowerMockito
I'm trying to mock a class constructor with PowerMockito for first time, but it doesn't work. My current code is:
public class Bar {
public String getText() {
return "Fail";
}
}
...
0
votes
0answers
4 views
Google OAuth signin redirecturl AWS
I'm trying to use Google OAuth for an application I deployed on AWS cloud. I have created the OAuth credentials and generated the client id.
I add the Authorized JavaScript origins as localhost, ...
-2
votes
0answers
16 views
Why is netbeans is treating my .txt file as css?
I am trying to make a program that will read names, social security numbers, and hours worked from .txt file and calculate total pay for those names then display them in a list. I can't tell if my ...
0
votes
0answers
23 views
Java - Validate if row and column num has been taken
I have a simple program using objects and classes that takes a value of row (int) and a column (String between a-h) and after 2 of each values are entered it displays the results that each piece holds....
0
votes
0answers
3 views
itextPdf on jar creating
I have a problem with a part of my project.
My goal is to print Jlists in PDF as shown in the code below.
When I run project in Netbeas everything works fine, but launching the jar file in dist ...
0
votes
1answer
5 views
Cannot resolve GetResources(), set context for non-activity class Android
I created DBHelper.java class in my android project. In my OnCreate() method I create tables to my database, but I also want to insert rows to these tables. So I made file - script.sql, that contains ...
0
votes
0answers
6 views
JNDI Look Up Exception - Could not obtain connection to any of these urls: localhost and discovery failed with error
sorry for my english.
I'm talking about JAVA EJB-WEB APP, project from my college.
so I tried anything so far to fix this issue before I post it.
I'm lost.. for real. it's 1 week I'm trying to make ...
0
votes
0answers
9 views
How is JpaTransactionManager envoked
I have the following for a multi-tenant application:
public class MultiTenantTransactionManager extends JpaTransactionManager {
private static final Logger LOGGER = LoggerFactory.getLogger(...
-1
votes
0answers
5 views
javaFX menu-button expand context-menu
Sorry for my English...
it's what I having now
But I want a full-width context menu like this
it's what I want(sorry, i'm bad painter)
Maybe I'm stupid, but I shared the Internet and found nothing....
0
votes
0answers
13 views
Logic Help - Java MySQL database logic checks
I'm currently working on a project where I've created a GUI interface that allows a user to create meetings by providing a date, start time, end time, etc. and adds it to an SQL database that stores ...
0
votes
1answer
12 views
JPA / Jackson - Exclude fields when deserialize and include them when serialize
I have a JPA entity with a couple of fields (the real ones are more complex). I'm receiving some data via REST (POST operation in a Spring controller) and storing it right away in the JPA entities; I ...
-2
votes
2answers
32 views
Array list with integers, receiving an error
I'm running this on an xml file and when I click on that particular button relating to this code it gives me an error. I think it has something to do with the arraylist combined with integers.
...
-4
votes
0answers
14 views
multi threaded chat application using java and swing
I am trying to create a multi threaded chat app (server broadcast msgs to clients).
I have created a thread in the client code to start the connection procedure when the connect button is pressed. ...
0
votes
0answers
6 views
Android Support Library (rev 25.0.1) Package inputmethod Unavailable
Using the new Android 7.1 (API level 25) Commit Content API, I've added image support to an existing IME project which is built into a Unity game (as an .aar) which works fine on 7.1+
However, when ...
0
votes
0answers
20 views
Xamarin C#: can't send List<int> through an intent
I've got a problem that I'm really scratching my head over. I just started trying to make an android app with Xamarin in Visual Studio, and I'm trying to pass a List<int> to a new activity, with ...
1
vote
0answers
10 views
Create Layered Tif with Java for use in Photoshop
I'm interesting in creating a layered tif with Java in a way that Photoshop will recognize the layers. I was able to create a multi-page tif, but Photoshop does not recognize the pages as layers. The ...
0
votes
1answer
31 views
java enumeration loop doubles up on repeat of cycle
I'm trying to make a trivia game in swing with CardLayout to change between screens in a single JFrame. I have a loop set to move through the states in my enumeration. Everything works quite well ...
-1
votes
0answers
9 views
what is the possible structure in javaFX to present a matrix
I have an apllication to develop it, this last concerns the manipulation of matrix
I don't find the structure to present a matrix in a javaFX,
I have trying to use a TextArea but it was imposible ?
...
0
votes
1answer
10 views
How to capture method arguments sent to a stubbed method using Mockito
Here's my stubbed method
Mockito.when(restTemplateMock.postForEntity(anyString(), any(), eq(String.class))).thenReturn(new ResponseEntity<String>(HttpStatus.OK));
How can I grab hold of the ...
0
votes
1answer
19 views
Calling third party REST API with curl in Java
I want to call this curl command to get list of applicant names from Java in JSON
curl -u uname:pass my_REST_Endpoint_provided_by_vendor
here is my code:
URL myURL = new URL("url");
...
0
votes
0answers
13 views
Writing Junit test to cover exception and catch block
I have written Junit test case for following function. When checked JACOCO test coverage. It is showing only try block is covered by test case. I am newbie to writing test cases. How the exceptions ...
0
votes
0answers
13 views
Java FX calling functions in multiple Windows
I encounter this problem at several places in my application.
1) I have one Window with a textfield and a button. On clicking, a function is executed that uses the input of the textfield. Everything ...
0
votes
0answers
9 views
cannot find symbol - method (Filereader method)
i'm working on a project which has 3 classes : Employe , which is an object with 5 variables. Entreprise is a class that creates a table to fit my Employees in. it also has different methods, ...
-2
votes
0answers
23 views
Java Regex - doesn't match for explicit start/end [on hold]
I want to match generic email addresses using Java Patterns with the pattern
^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$.
I've tested this with multiple online regex matchers and it ...
0
votes
0answers
15 views
How to use ScrollPanel with relative size
I'm trying to use a ScrollPanel of GWT in a page. Since most of the contents are in the ScrollPanel, I want it to take an as-large-as-possible part of the page and resize as the page may resize. ...
-1
votes
0answers
25 views
the code i made is at the bottom netbeans keeps giving me errors
It would be nice to create a box that is bigger than a given box. Write this method:
public Box biggerBox( Box oldBox )
This is a public method that returns (evalutes to) a reference to a new Box. ...
1
vote
1answer
13 views
Stop objects from going out of bounds in Tetris game
I'd like to stop my shapes from being able to move so far left or right that they go off the screen, but my outOfBounds method which I've implemented in my KeyHandler is receiving this error:
1 ...
0
votes
1answer
10 views
What is the term used for reusing strings and colors?
When I have multiple colors, strings and drawables that are constantly reused throughout the whole application, what is the term for this to describe it?
Is this called inheritance?
0
votes
0answers
10 views
How do I tell IntelliJ about groovy installed with brew on OSX
I'm running:
IntelliJ Ultimate 2016.3
Homebrew 1.1.2
OS X 10.11.5 El Capitan
I ran brew install groovy which resulted in groovy being installed in /usr/local/Cellar/groovy/2.4.7/. Brew also added ...
0
votes
1answer
22 views
How can I sort a 2d array and keep track of the array indexes?
I have a 2d array which has 500 rows and 250 columns.
{ 0, 1, 2, 3, ... 250
1, 1, 1, 1,
2, 2, 2, 2,
...
500
}
I would like to sort the values by column and be able to keep track of ...
0
votes
0answers
8 views
embedded derby starts with J2C error
I create a datasource as
@DataSourceDefinition
(
name="java:app/env/myDataSource",
className="org.apache.derby.jdbc.EmbeddedXADataSource40",
databaseName="myDB",
properties=
{
// ...
3
votes
0answers
14 views
How to implement HTML/XML Parser from Python to Java?
The question is:
Implement XML/HTML Parser: essentially the same as the input is a tokenizer object, you can call its getNextToken() function to get the next token, token structure including name and ...
0
votes
1answer
14 views
How to add beats per-minute calculator to a Processing code?
I am using a code I got from a site for a heartbeat sensor. The signal, when displayed by this code looks something like this:
Could you help me add a check which will increment an integer every time ...
0
votes
0answers
12 views
How to save objects into mongodb?
Repo
public interface AppPortRepository {
AppPortModel save(AppPortModel appPortModel);
void remove (AppPortModel appPortModel);
List<AppPortModel> findAll();
}
Repo Impl
@Repository
public ...
-1
votes
0answers
21 views
If write(0x01234567) is called on an instance of output stream, what will be written to the destination of the stream?
Hi,I have a question
If write(0x01234567) is called on an instance of output stream, what will be written to the destination of the stream?
a. The bytes 0x01, 0x23, 0x34, 0x45, and 0x67, in that ...
-7
votes
2answers
30 views
Java Skips over “While” loop [on hold]
Forgive me if this is something stupid, as I am relatively new at Java
The current program compiles, however it completely skips the while loop.
//Defined Variables
static boolean breaker = ...
0
votes
0answers
3 views
Error while compiling AIDL
I'm trying to compile .aidl and generate .java but:
Error:Execution failed for task ':library:compileReleaseAidl'.
> java.lang.RuntimeException: com.android.ide.common.process.ProcessException: ...
0
votes
1answer
24 views
Making thread.sleep() stops the previous code [duplicate]
I want to make a pause after an event. But when I use Thread.Sleep(1000), it also stops the code above. For example:
attackButton.setOnAction(e -> {
int playerAttack = player.getAtt();
...
0
votes
0answers
12 views
How do I conditionally render markup in a JSP based on arbitrary condition?
Hi I'm maintaining some legacy JSP code and I need to be able to do some conditional rendering like
<c:if test="${SomeClass.staticMethod(obj.getUrl())}">
<td> ... </td>
</c:...
0
votes
1answer
11 views
Java Swing DocumentFilter for UpperCase
Click here to show the gif
DocumentFilter df = new DocumentFilter(){
@Override
public void insertString(DocumentFilter.FilterBypass fb, int offset,String string, AttributeSet attr) throws ...
0
votes
0answers
11 views
Mapreduce: program to find average of numbers in text file error
When I run this code on putty I get this error: mapreduce Exception in thread "main" java.langjavascript:void(0).ClassNotFoundException:GameRatings.java. I don't know what to do. I'm also not sure if ...
0
votes
0answers
17 views
Unable to fetch data in Eclipse
I'm a beginner and trying to learn selenium webdriver. I have connected the database in Eclipse, but when I try to execute the query it gives me the error
Oracle JDBC driver loaded ok.
DB Connected ...
-1
votes
1answer
14 views
Send a Post with url parameter with Retrofit 2
I want to send a POST with Retrofit 2. The url has some parameters:
@Headers({
"Accept: application/x-www-form-urlencoded;",
"User-Agent: my-app"
})
@FormUrlEncoded
@POST("server/...
0
votes
1answer
16 views
What am I doing wrong with my image denoising method?
I've been trying to denoise my image by using a median filter as described in this article
I'm only doing one pass until I get this thing working. The result is largely a washed out image, as seen ...