Questions tagged as 'java'

1
answer

How to get the result of a JUnit assertEquals test and why in a String type variable?

I'm having a JUnit test case to test a simple class. The class to be tested contains only one "sum" method that adds two numbers. To test if it is correct, I use the following method: Assert.assertEquals(2, meu_objeto.sum(1, 2)); The resu...
asked by 25.04.2016 / 18:53
2
answers

Error in classes that implement java.io.Serializable

I have some classes that implement java.io.Serializable, when I go to compile, they all present a warning:    The serializable class Fat_uc_dataStatementSql does not declare a   static final serialVersionUID field of type long What can be...
asked by 09.08.2016 / 03:52
1
answer

My .jar files generated by Eclipse are not opening

I've done everything I know and found on the internet to open a .jar file, but nothing works. When I give 2 clicks it just does not open, it does not give a mistake, but it also does not open anything. I have already tried to run through the Win...
asked by 07.08.2016 / 19:45
1
answer

How can I make my code with fewer rows?

I currently have a large number of lines in my code: Below the player insertion part, these players will have the names searched from the bank and sent by cmb box. private void Verificar() { String jogadores = JOptionPane.showInputDialo...
asked by 10.08.2016 / 02:06
2
answers

Error using radiobutton getText () method

I created a very simple app to calculate a bill with tip add where I enter a value, select a Radio Button with a percentage and it generates the final value as a result. But every time I click on "Calculate" it stops working and closes with t...
asked by 24.08.2016 / 21:59
1
answer

Execute servlet before loading index.jsp

I'm trying to run my servlet before loading index.jsp because the information contained in the index comes from a query in the database. I tried using <jsp:forward page="/servlet"/> But it did not work. How can I do this?     
asked by 26.08.2016 / 00:21
1
answer

Error: RuntimeException when trying to mount test case

I'm trying to set up a simple test using espresso and the following errors appear: Code:importandroid.content.Context;importandroid.os.Bundle;importandroid.support.annotation.Nullable;importandroid.support.test.InstrumentationRegistry;import...
asked by 25.08.2016 / 19:05
1
answer

Click on the screen and change the values of the variables

I need to implement in the code functionalities so that when I click on the screen, I change the values of some variables that are in the code. However, when I click, it stays the same. My main class : /* * To change this license header,...
asked by 30.06.2016 / 15:33
1
answer

Start all CheckBoxes of a selected JTree

I would like to know how I could do to start the class already with all checkboxes checked, I found this class and I used: package CustonComponents; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.MouseEvent; im...
asked by 01.07.2016 / 16:21
1
answer

Text changes on label with switch

Do you know that initial Pokemon conversation?    "Welcome to the pokemon world" - ENTER   "Are you a girl or a boy?" -ENTER   CONTINUE .... So, I'm trying to do one through Java swing, at the moment it looks like this: private void j...
asked by 29.05.2016 / 02:12