Questions tagged as 'swing'

1
answer

Multi Processing / Multithread is not working

I want to try to solve the problem of when the client can not connect to the server (connection failure, server down, etc.). In my main class is the connection to the server and I want that in case of giving error caught by try ... catch(C...
asked by 04.11.2014 / 12:11
1
answer

JDialog does not show JLabel

I created a class called JDialogProgress, but when I "call it" the JLabel object does not show on the screen. I'm calling it like this: JDialogProgress Progress = new JDialogProgress(new JFrame(), false); Progress.setVisible(true);...
asked by 14.08.2014 / 18:16
1
answer

ActionListener does not identify the retrieved button

My goal is to click on the Andar button and then select on the board to which direction the character will be moved, as the image shows: MyAndarbuttonhasActionListenerandistreatedasfollows:publicvoidactionPerformed(ActionEvente){Obje...
asked by 13.06.2018 / 04:28
2
answers

JOptionPane in the foreground

I have an app that uses JOptionPane to show an error message, however I would like JOptionPane to always appear in the foreground. JOptionPane.showMessageDialog(null, "Usuário ou senha incorreto!", "Erro", JOptionPane.ERROR_MESSA...
asked by 01.11.2017 / 19:29
1
answer

How to maintain the aspect ratio of the screen after being resized by the user?

I need to restrict a certain proportion of a JFrame so that the layout of what I want to display on it is not distorted, but I would not want to have to block resize with setRezisable() . The minimum aspect ratio for testing is 350x500 (7:...
asked by 29.09.2017 / 13:06
1
answer

Formatting Data with SimpleDateFormat

My problem is this: I have JTable with several populated columns with data pulled from my database. Some of these columns are time values, for example, 0834 is pulled from the database and I would like it to be displayed 08:34...
asked by 17.11.2016 / 03:40
1
answer

Change title bar and window icon

I want to change the icon of the title bar of the Java window, as shown below: I'mgoingintheinitComponents()methodandleavingitasitisinthecodebelow,butthesetIconImage(iconeTitulo);lineisanerror.publicFrmConfiguracoes(){initComponents();URLcam...
asked by 23.08.2016 / 04:41
2
answers

Add line in JTable when clicking the button

I'm starting to create an interface in Java, an example I'm trying to do is to have a form with textField nome and email , and clicking the Enviar button will% for my textField , but I am not able to manipulate my ta...
asked by 30.03.2016 / 20:37
0
answers

Sorting with colored cells and Date column

I have two problems with finalizing my table: 1) I have% custom% to paint an entire row based on the value of a column. It works, but when I click to sort, the colors of the lines do not follow the classification. They are "crazy". 2) I ne...
asked by 04.08.2015 / 23:11
1
answer

Arrows do not move in text field with regex [closed]

I have the following code with a regular expression inside a Keyreleased method, which allows only a few characters to be entered by the user into a text field: String text = input.getText(); text = text.replaceAll("[^A-Za-z&\|!]",...
asked by 31.10.2017 / 23:57