Questions tagged as 'swing'

1
answer

Resource JFrame Icons

Good afternoon. I'm having problems with my application. It executes with change of icon in JFrame . When compiling it to: "Runnable Jar file" and compile with: Launch4j for binary, the application simply does not open. I am changing...
asked by 29.03.2015 / 16:51
1
answer

JTable does not show column names

I made a JDialog that will show some statistics of the users who use the software, but I am not able to make the name of the columns appear. I tried adding it using .addColumn in the template but it is not working. class Estatisticas e...
asked by 27.03.2015 / 19:11
1
answer

Return names of selected items from a checkboxTree

How can I check which items are selected from a checkboxTree ? I've had to search and I know this code returns the last selected: DefaultMutableTreeNode node = (DefaultMutableTreeNode) checkboxTree1.getLastSelectedPathComponent();...
asked by 04.12.2014 / 18:44
1
answer

How to update a jTable that displays DB data after registering a new item?

I have a table (jTable) that displays all the data registered in a database. My table is populated every time the application is started through a WindowEvent, but when I make a new record in the database through another frame I can not get my j...
asked by 22.11.2014 / 18:51
1
answer

Using Napkin LookAndFeel

I'm using the Eclipse IDE and I have this code: package br.com.caelum.argentum.ui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import javax.swing.JButton; import javax.swing.JFrame...
asked by 08.10.2014 / 01:22
1
answer

How to prevent moving the cursor in a jFormattedTextfield with mask?

I have a field formatted as follows: '### ### ###' When I click on the field that contains this mask sometimes the cursor stays in the middle or where I click. Example: '## | # ### ###' Is there any way to prevent the cursor from being...
asked by 31.10.2014 / 18:07
1
answer

Organization of the codes generated by WindowBuilder

I'm using WindowBuilder to draw the graphical interface, but there's one thing that's kind of boring in it, which is as follows. When I create a JLabel for example, it declares the JLabel inside the constructor, making me unable to use it direct...
asked by 23.07.2014 / 09:45
1
answer

Adjust image size with ImageIO Java

I would like to resize an image to be displayed on my jLabel. Here's my code: BufferedImage imagem; Icon novaImg; try { String newPath = "file:///" + aleat(); // carrega imagem aleatória imagem = ImageIO.read(new U...
asked by 16.06.2014 / 22:54
4
answers

Select and drag component Swing

I made an application that draws rectangles, points, lines, etc. I wanted that when the user clicks the mouse over a drawn polygon, you select the polygon and drag it to wherever you want on the screen, How to achieve that goal?     
asked by 29.01.2014 / 13:23
1
answer

How do I handle the JOptionPane.showMessageDialog () options?

How do I handle user choices in JOptionPane.showMessageDialog() ? For example, when the user chooses ok the program continues normally, if he chooses cancel the program executes another line of code.     
asked by 07.05.2014 / 16:59