Questions tagged as 'swing'

1
answer

How do I add a background image to a Jframe?

I'm trying to change the background image of my JFrame, but I'm having difficulties. Here is the code: public class teste_tamagotchi extends JFrame { private JPanel contentPane; /** * Launch the application. */ public static void main(Strin...
asked by 14.10.2016 / 17:14
2
answers

Jcombobox within a JOptionPane

Good morning, I have a list of some reasons private List<Motivo> motivos; I need to populate a jComboBox with this list and get the selected option. Currently I have done with MessageDialog where I can fill normally but I can not...
asked by 18.07.2016 / 15:03
2
answers

In java, how do you make only one JFrame window close when you click on x, instead of all?

I'm doing a Java program with multiple windows JFrame , and I wanted it to, when I pressed the x of one of the windows, it only closed, instead of all of them.     
asked by 28.06.2015 / 03:07
1
answer

Enable and disable JButton

I have two JButton in my window, btnCalcular and btnConfirmar . btnCalcular computes some values in the window, and btnConfirmar takes those values and stores them elsewhere. The issue is that obligatorily I...
asked by 16.04.2016 / 17:10
1
answer

JTextField that accepts only two letters [duplicate]

How do I make it possible for me to enter two letters on the keyboard and not use any other letter, number, or character in a JTextField ? For example: in a field I only want it accepted either the letter T or the letter F (upper case)....
asked by 07.07.2017 / 14:50
1
answer

Delete only rows with checked checkbox in a JTable

How do I delete a row from a% w / o of the lines that are marked in a CheckBox that is in a table cell? I'm using JTable . The code I was able to create, just delete some of the selected records, there is always some left over. I cre...
asked by 01.11.2018 / 19:24
1
answer

How to position a browser inside another JFrame interface?

I'm designing a Java project to simulate a proxy server with authentication that has a single interface, inside which multiple internal frames are arranged. How to position a browser within this JFrame interface? See the project templa...
asked by 19.10.2018 / 15:19
1
answer

How to trigger a method when finished editing a column of type Integer in JTable

I need to call a method that shows the user a message. This method must be called just as the user finishes editing a JTable column of type Integer and the user has not entered an integer. That is, the method should be called the moment th...
asked by 18.05.2018 / 22:04
1
answer

How do I start by editing a JFrame on hand and continue the final adjustments through the Netbeans "dashboard"? [closed]

I was able to create by writing the code or generating a new file of type javaswing + JFrame , but I would like to do writing the code and continue editing with the "panel", without needing to add a "new file.     
asked by 17.02.2018 / 22:17
1
answer

Copy JTable column to Clipboard?

Here I have a table template with 4 columns and several filled lines that I get in the database. I would like to create an Action button that copies columns 2 and 3 at once to the clipboard, so you can paste, for example, into an Excel or other...
asked by 29.01.2018 / 11:37