Questions tagged as 'java-swing'

1
answer

Scrollbar

I want to put a scroll bar both to the right and to the bottom I know I have to put JScrollPane but I do not know where I would put it or how. This is the code: package bonos1; import java.awt.BorderLayout; import java.awt.Color; imp...
asked by 06.07.2018 / 19:33
1
answer

help with jframe

I have an application that opens a jframe and I need that when it opens the same I block the application from behind, that does not let me touch the application after, that the focus of the application is in new jframe. What method of jframe all...
asked by 04.07.2018 / 17:59
1
answer

'Unreachable statement' error in java

I get an error without an apparent sense on line 78: (    78 | System.out.println ("Exit"); import java.util.Scanner; import java.util.ArrayList; public class nochevieja{ public static Boolean verificar(String horario){ //00:00 fi...
asked by 23.06.2018 / 05:28
1
answer

Pattern for the creation of tabs of a JTabbedPane

I have a class AdminUI2 , which contains a JTabbedPane with 6 tabs and each tab has its respective JPanel and each JPanel contains its respective components. The problem that arises is that each JPanel created makes the cl...
asked by 16.10.2018 / 12:01
1
answer

"invokeLater (Runnable obj)" - doubt

Although I have already designed some applications in Java I am following a language manual to establish the base of this language. I have reached the SWING part. In the manual they create an example class in which an object of type JFrame is...
asked by 26.04.2018 / 16:30
1
answer

Calculate the residual of a total deferred value to installments and add it to a jtable?

private void PLAN_DE_PAGO_CREDITO() { int cntCuotas = 14; int totalVrCredito = 1.400.000; DefaultTableModel tableModel = (DefaultTableModel) TB_PLAN_PAGO.getModel(); for (int i = 1; i <= cntCuotas ; i++) { int valorCu...
asked by 30.03.2018 / 10:24
1
answer

show JTable based on selection JComboBox

I am developing a small application that fills me with a JComboBox based on a ResultSet. But I can not get it to show me a JTable with the results of a select *. To fill the JTable, I am using a mouse event so that when I select the table the JT...
asked by 08.04.2018 / 12:42
1
answer

How to put a jCalendar in a cell of a JTable in Java Swing

I have to place a jCalendar in a cell of a table that I filled with a query from a database, but it has to be with java swing. I am trying it through a mouseclick event, I leave here the one that contains the function. int fila; fila = (In...
asked by 24.03.2018 / 18:00
1
answer

flows streams with * .dat files

I'm making an application with swing and I need to link data that I enter for that application to a * .dat file. The fact is that I have three packages and each package with its * .java: Package 1: Class Vehicles with their attributes and met...
asked by 07.03.2018 / 20:18
1
answer

How to print an array in a JtextField in Java Swing?

I want to print an array that generates it in the following form public String buscar(){ numero = (int) (Math.random() * 3) + 1; palabra = libreria[numero]; return palabra; } public void cambiar(){ for(int i = 0 ; i < palab...
asked by 26.02.2018 / 21:40