Questions tagged as 'swing'

1
answer

By icon in JFrame

Would it be possible for icons in the executable application via code?     
asked by 02.06.2017 / 22:47
1
answer

How to move animation clockwise?

Well, I'm developing a project that simulates the controlled environment of train tracks, where I have 3 trains running clockwise, where the three pass through the same place in certain sections. My first question is, how to make the movement of...
asked by 03.08.2017 / 20:31
1
answer

How to change the background of the JTable header without removing the border?

I'm trying to change the background color of header of JTable . With this code I was able to: public Principal() throws UnsupportedLookAndFeelException { initComponents(); jTable.getTableHeader().setDefaultRend...
asked by 04.11.2016 / 16:16
1
answer

How do I keep the Look And Feel selected in the JComboBox after the window is closed?

I just created a simple JFrame in NeatBeans with some Look And Feel's (LAF) available, using a JComboBox so that the user chooses the LAF you want, and I also put the "Save" button for Action I can change the "Theme" perfectly....
asked by 31.08.2016 / 03:43
1
answer

What is the advantage of using BufferedImage for images?

I want to know the difference in using BufferedImage and the graphics method to draw the images to ImageIcon . Here is an example: @Override public void paint(Graphics g) { g.drawImage(bfImage, 0, 0, this);...
asked by 14.01.2017 / 21:54
1
answer

Pass the execution of a given method to the SwingWorker as an argument

I have a small application in swing , where I would like to display a progress when certain actions are executed As an example, I have the listener below that is executed when a JComboBox is changed. It takes the selected...
asked by 28.03.2016 / 15:36
1
answer

Thread from a flashing point

Hello, I made a program that you move a ball with the arrow keys that only flashes the screen when it moves. I've seen other programs in this kind of mine that just do not blink. If anyone can help me... (the background stays normal but the ball...
asked by 22.03.2016 / 02:16
2
answers

Returns the database's data in a JTextField

I'm having a question about listing the data I've written to a database with JTextField . I created a screen, with the field for the user to enter the cadastre ID in the bank and a FILTER button. I want, when I click on Filter, the data fo...
asked by 31.03.2016 / 18:07
4
answers

How to change the text color in a JTextPane?

I'm developing a chat and it uses JTextPane to display messages in different colors for each user. However, I'm not sure how I can change the text colors of this component. Example: We have two people (John and Peter), when I receive...
asked by 22.07.2016 / 21:41
1
answer

Update a Jtable that is in a JFrame from a JDialog

What I'm doing is a little longer, so I'll shorten the problem with a more objective example: I have a registration form and created a modal Jdialog with the fields that I want to search. When I search in JDialog I would like to filter the in...
asked by 02.02.2016 / 12:28