Questions tagged as 'java'

2
answers

Error declaring JTextField vector in class

Well, I would like to store all my JTextField in an array, but when I define the array, I get the following error: llegal forward reference . Below is the code where I define the array. private JTextField campos[] = {campoNome, ca...
asked by 10.09.2017 / 16:38
1
answer

Save state of a CheckBox

I need to save the state of my CheckBox, they are inside a Spinner, and every time I open the Spinner it clears the CheckBox. AdmList.java final String[] select_qualification = { "Todos", "1", "2", "3", "4",...
asked by 13.09.2017 / 19:22
1
answer

HSSFWorkbook - How to copy one worksheet to another? [closed]

I have an excel worksheet that I need to copy some data to another worksheet. This old spreadsheet is like a "base", I need to copy only the header and caption part (with the style of the cell, in addition to the text). I'm using the HSSFW...
asked by 05.09.2017 / 20:21
2
answers

How to implement a class to use PreparedStatement through it?

I have the following class Connects.java package util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; public class Conecta { //Pode...
asked by 20.03.2017 / 02:03
1
answer

RequestContext as null

I'm trying to update an on-screen component with RequestContext of primefaces . However there are 2 situations where the first one is I click on a link and the page gives its refresh. The second situation is where I have a scheduler...
asked by 30.03.2017 / 01:32
1
answer

Calculate age by taking a date of type Date

I would like to calculate the age by taking the date of birth from the database, using pojo . I was looking at how to do a date calculation by looking at this question: Calculate age by day, month, and year My date in the database...
asked by 06.08.2017 / 03:18
1
answer

Update a Jtable within a Jframe through another Jframe

I have a JFrame , where inside it has a JTable and a JButton (Change) that calls another JFrame. In this other JFrame, a change of data is performed according to the row selected in the table and saved in the DB when clicking...
asked by 24.07.2017 / 17:21
1
answer

How to convert java.util.Date to java.sql.Date keeping hours, minutes and seconds?

I'm doing a Java program. In it I get a date of type java.util.Date , but I need it in java.sql.Date so I can insert it into the database. But on that date, I have hour, minute and second and I would like to insert with all this dat...
asked by 03.11.2017 / 21:24
1
answer

How to capture the closing event on a Stage?

I'm looking for an "windows close" Swing event.     
asked by 09.11.2017 / 21:28
2
answers

Refresh ComboBox that receives a list from another panel

I have a screen where I register a movie, and I play for a ArrayList with a Movie class, which contains some attributes such as title, year, nothing else so far. So I want it on my other screen where I have a comboBox called "Select Mo...
asked by 03.12.2016 / 23:12