Questions tagged as 'java'

1
answer

Open new window from button

I want to create a new window when the user clicks on a certain button, while this new window is open, the main window can not be used. How can I do this in JAVAFX? I thought about doing the following sequence of commands in the button's OnAc...
asked by 19.09.2017 / 15:14
1
answer

Hibernate does not find mysql JDBC driver class in Maven project

Hello everyone, I created a maven project in eclipse (with WAR packaging) and I imported the packages of models already mapped from another project, I then created a class to "load" a factory of persistence but it returns the following error:...
asked by 19.09.2017 / 15:18
1
answer

Date conversion / formatting issues

I'm having trouble formatting a date to be useful, I need to format a date that is Tue Nov 22 00:00:00 BRST 2017 (example) to date in dd/MM/yyyy format. I've been seeing some links, such as: How to convert one string in date or date? but i...
asked by 08.09.2017 / 02:24
1
answer

Double click first button to execute method

I'm developing an application in JavaWeb with the framework BootsFaces and PrimeFaces. In one of my screens I have a form with a datatable of BootsFaces that when clicking on one of its lines triggers the method selectsUsuario () that updates...
asked by 05.09.2017 / 20:32
2
answers

How to report data in a vector

I can not report 10 student grades. import java.util.Scanner; public class exer { public static void main(String[] args){ Scanner scn = new Scanner(System.in); double[] N = new double[10]; int i; for(i=0;...
asked by 11.09.2017 / 08:31
1
answer

What is the problem with these hash algorithms?

I have searched for several hash algorithms, and found some example in SOen, but they are returning different hashes to the same file: import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream;...
asked by 02.02.2018 / 21:56
2
answers

Error trying to compare date

I'm trying to create a validation, to know if the user is at least 12 years old. I tried to base myself on this question: Comparison between dates . However, I think I'm comparing it wrongly, since it gives me the following error: Exce...
asked by 09.09.2017 / 21:19
1
answer

Float to Byte Array Conversion

How can I be converting from float or integer (if possible) to a byte array in Java. Let's say: float x=180 Theoretically you would need to create 1 array of bytes with 2 positions. Is there any way to 'automate' this?     
asked by 17.08.2017 / 21:01
1
answer

Invoke a method by reflection

I took a look at this question Has how to pass methods as a parameter? and tried to invoke one method from one class, in another, passing as parameters the screen / class and the method name. The purpose of doing this is that in my applicat...
asked by 28.03.2018 / 00:16
1
answer

Json - JAVA (Eclipse)

How do I read a JSON (jsonl) file through eclipse in java? Do I need a package?     
asked by 28.03.2018 / 17:41