Questions tagged as 'swing'

2
answers

Doubt - setDefaultCloseOperation

Would it be possible to somehow move to: setDefaultCloseOperation(UM METHODO?); Or using some other option to do the same procedure? What happens is that I created a button and it calls a "method" to hide the program. I need to click on...
asked by 30.03.2015 / 14:12
2
answers

Positioning tabs on top of table using layout manager

I'm having problems positioning components. I have a table, and 3 buttons, and I'm trying to position the buttons above the table centrally. Example: ItriedtouseFlowLayout,andtheresultwasthis:importjava.awt.Dimension;importjavax.swing.JButto...
asked by 03.09.2017 / 02:58
2
answers

How do I change the increment of a button through another button?

I have a button that adds a variable: x + 1 , and every time I click this button, the variable will increase by 1 unit. But how do I program a button to change the function of button 1, so that instead of x + 1 , be x + 2...
asked by 21.06.2016 / 19:09
1
answer

How to leave only one border in JTextField?

I would like to know how to just leave a border in a JTextField , similar to the data entry at the time of logging in Gmail, that is, with a border just at the bottom.     
asked by 14.07.2017 / 01:37
1
answer

Problems with calculator operations made in swing

I need to make a calculator, which works like windows. I am having trouble at the moment the user can change the type of operation that he wants to perform. For example, if he typed 10 + and wants to change the signal from + to -, he clicks t...
asked by 28.03.2016 / 19:49
1
answer

Currency mask for JTextField

I have a JTextField field that should receive a monetary value from the user. I would like to add a mask to this field so that it will format the values entered as follows: 9999.99.     
asked by 19.11.2014 / 19:26
1
answer

Select Multiple rows in JTable in Java

Good evening, my question is how to select multiple lines in an action, I want to create a condition in a column if the value is bigger select the line, but if you have equal values, you have to select it as well. I tried to do this in the code...
asked by 19.10.2015 / 01:32
1
answer

Why unmark main class creation when working with screen?

So far, in all the tutorials I've seen, when we're going to work with a swing screen, we're asked to uncheck the main class creation. I'd like to know the science behind this, and what happens if I do not do it in such a way. Edit: It's in...
asked by 14.11.2017 / 12:18
2
answers

How to know when two threads have ended in Swing?

I have a method that performs two tasks. I would like two threads to perform each task. Tasks do not share data, they are completely independent. Before starting the tasks, a dialog is displayed with the "Wait, processing ..." i...
asked by 24.10.2014 / 20:21
3
answers

Recover / locate object in arraylist

I am doing a small CRUD with the theme saving for study purposes. I created 3 classes: Savings, Accounts and Screen (UI Swing). On the screen I register an account with the attributes name, agency, account number (the balance starts with valu...
asked by 13.03.2018 / 10:24