Questions tagged as 'swing'

1
answer

Close window when clicking JButton

Is it possible to click on a button and JFrame to be closed as if I had clicked on the X of the window? If it is possible, how do I create it? What I've already studied is using ActionListener but I can not find the code to clos...
asked by 14.11.2017 / 01:37
1
answer

Can I create a complete application without using the swing? [closed]

I'm creating a system and a question has arisen! Could you create forms without using Swing, AWT or the basic libraries in Java? If I use another framework, can I leave out the Swing, AWT etc? What better framework to work with today?    ...
asked by 08.07.2017 / 16:38
1
answer

Buttons do not display correctly

I'm trying to add 2 JButtons to a program, I make the whole process to add, but it shows only one. package ldegraphic; import java.awt.Graphics; import javax.swing.*; public class LDEGraphic extends JFrame { JButton jb = new JButton("Adic...
asked by 21.10.2017 / 16:38
1
answer

How to hide and block the last line of a JTable?

Is it possible to hide and block the last line of a DefaulTableModel ? I have this difficulty and I can not solve it. If not, is it possible to hide this line? import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swin...
asked by 05.10.2017 / 16:02
1
answer

How to centralize a component using null layout?

My button I want to center is 100 pixels wide. the Jframe is 350 wide. how to centralize? /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open...
asked by 01.03.2017 / 03:24
1
answer

How to capture colors of an image in a JLabel that behind another JLabel?

I need to get the pixel colors of an image embedded in a JLabel with MouseMotionListener , and this JLabel is under or behind another JLabel. I know I can get a background color behind a JLabel, but what I need to capture are colors...
asked by 14.04.2017 / 04:14
1
answer

how to make tabbedPane concealable?

I'm having trouble trying to make a tab (tabbedPane) that is displayed according to the status of a CheckBox ("selected / deselected"). I do not know if it is possible, since it will end up changing the size of the screen at runtime. What I'v...
asked by 15.04.2017 / 02:06
1
answer

How do I retrieve a line in my jTable?

I would like to know how to retrieve information from a line of my JTable , follow the line of code of it. Usuarios operacao = new Usuarios(); DefaultTableModel tabela = new DefaultTableModel(); private void adicionarLinhas(String nome,...
asked by 08.12.2016 / 00:08
1
answer

How to display the date and time "at runtime"?

I would like to know how to display the current date and time of the computer, and the time must be updated at run time. I thought of passing an object to a label, but it did not. I will not save that date, I just want it to be displayed, I want...
asked by 04.02.2017 / 13:50
1
answer

Place a table created in an existing container

I need help! I'm developing an application in college that will use BubbleSort - yes! We had the misfortune to get this! - to sort some data within a table. I created the table through a class that extended AbstractTableModel, however I ca...
asked by 26.08.2016 / 18:22