Questions tagged as 'swing'

1
answer

Capturing events on a button

I'm starting in Java GUI and wanted to understand how event trapping works on a button, such as in the code below: SimpleGui1.java import javax.swing.*; import java.awt.event.*; public class SimpleGui1 implements ActionListener { JB...
asked by 03.08.2014 / 06:40
1
answer

How to make the list of Combobox items bigger than Combo itself?

How can I make visible all the contents of the combobox that I have without increasing its size? Today it looks like this: Iwantittolooklikethis: Update Through a comment, I found the solution this link .     
asked by 07.11.2014 / 17:59
1
answer

Popup of JComboBox is visible until you click the arrow

I have a JComboBox populated with JCheckBox's working normally, but when I click on an item, the JComboBox popup closes. To see if JCheckBox has really been checked, it is necessary to open it again. I wanted to know if it's possible t...
asked by 25.06.2018 / 20:20
4
answers

Convert Int to String

I'm trying to make a button to register the bank but I'm having trouble converting the int to String. Follow my line of code: private void jBtnCadastroActionPerformed(java.awt.event.ActionEvent evt) {...
asked by 30.05.2018 / 20:32
1
answer

Doubts about the Graphics and Graphics2D classes in Java

I'm having a lot of questions about Java graphical libraries, which are as follows: What is the difference between overwriting the paint(Graphics) method or the paintComponent(Graphics) method? What is the Graphics2D...
asked by 12.03.2018 / 02:15
1
answer

How to create a folder browser in java swing?

I want to create a window and it has a button, when the user clicks that button, that "windows folder browser" will appear for the user to select a folder of his machine and the address of the folder is saved in a variable. It is possible? I do...
asked by 18.11.2017 / 00:56
1
answer

How do I define the size and location of components?

I created this code in java to train a little and learn but I can not set where JComboBox and JTextField will appear and the size of them like I do? I want to leave them in the middle of the window without being glued to the edge o...
asked by 21.10.2017 / 19:29
1
answer

Data not displayed in table by AbstractTableModel

I'm developing a ticket request system, however because I have to add JXDataPicker to the table, I had to implement AbstractTableModel . The model apparently complies with the documentation, I can display all the fields, but I ca...
asked by 30.10.2017 / 04:46
1
answer

Placing components inside a JFrame

I'm trying to position some components on a screen, but it's not working very well. So I created a simple example to illustrate the problem. I accept submissions to perfect the way I'm doing. Note:WheneverIaddapanelinsideatab,Icannotgetittos...
asked by 01.05.2017 / 23:20
1
answer

How to change Graphics2d objects out paintComponent

I would like to know how to change the color of a drawRectangle() of Graphics2d of java, outside the @Override paintComponent() method. It turns out that this change should be temporary, only when the mouse pointer passes...
asked by 01.03.2017 / 15:56