Questions tagged as 'java'

1
answer

How do I get the methods to receive the x and y parameters?

When I request the values of x and y , I want to make the operations of the methods receive the values entered by the user. What to do? public class Calculadora { Scanner sc = new Scanner(System.in); protected double x; protected...
asked by 10.11.2017 / 13:47
2
answers

javax.servlet.ServletException: java.lang.ExceptionInInitializerErro

I'm trying to create my first project using JPA, I use Jboss 5, Oracle, Hibernate and primefaces. After doing the project deploy I try to create and inseir a new client in the bank through the web interface, but I am getting the following error:...
asked by 14.07.2017 / 05:11
1
answer

Item in comboBox selected, display data in jTable

Before asking this question, I looked in the forum and in several places but I could not solve ... I have a comboBox that already loads the names of the clients, there I wanted to select the client, and on a ok button to fetch that cli...
asked by 09.07.2017 / 14:46
1
answer

How to get the context in a fragment?

What should I insert into a method that needs the context argument in this fragment? public class Tab1tests extends Fragment { private ViewPager mViewPager; private DatePickerDialog.OnDateSetListener hourSetListener; private DateP...
asked by 08.07.2017 / 13:37
1
answer

For the same value last time it was used [closed]

How do I make the value of contador of for start with the same value as last time it was used? Because this for always starts when I start activity , and I need it to not start at 1 each time I start activity , w...
asked by 18.07.2017 / 19:29
1
answer

Controlling the session on android

I'm using SharedPreferences to generate a session on android. I wanted to do a check that, after a while (5 minutes for example), it gives a timeout, zeroes that session and redirects to the Login. Is it possible to do this using SharedPreferenc...
asked by 05.07.2017 / 18:02
3
answers

Numbers below average

I need to average 20 numbers and have all numbers smaller than average. package pag1; import java.util.Arrays; import java.util.Scanner; public class ex2 { public static void main (String[] args){ Scanner x = new Scanner(System.in);...
asked by 04.07.2017 / 00:18
3
answers

Doubt about instructions that can be implemented in Hibernate

Java programming language technical course test question:    What instructions can be used in Hibernate?       a- JDBC       b- JPA       c-SQL       d-JNDI     
asked by 18.09.2017 / 15:09
2
answers

How not to lose decimals when doing "longProperty1.divide (longProperty2)"?

What I want to do is very simple, I just do not know how to "do it right" in JavaFX: I have two LongProperty ( num1 e num2 ) and a DoubleProperty ( resultado ) , where this DoubleProperty resultado must contain...
asked by 16.09.2017 / 23:39
1
answer

JTextPane Word Wrapper

I am not finding a method to organize the lines within a JTextPane, and I need to continue styling but also with a Word Wrapper, is there any method or component that makes it look like this? public class PanelTeste extends javax.swing.JFrame...
asked by 02.09.2017 / 14:09