Questions tagged as 'swing'

2
answers

Display JCombobox object data in a JTextArea from the selected item

I wanted to show data from a client that is in a combobox inside a JTextArea, as in the following image: Theproblemisthatonlytheinformationof"Igo Brasil" is shown, when I try to show the information of another client, this happens: Infor...
asked by 25.04.2016 / 02:46
1
answer

Initial focus on JOptionPane OK button

I have the following JOptionPane : AsyoucanseethefocusisontheCancelTeacherIneedthisfocustocomeoutOK,butIhavenoideahowtodothis.Mycode:JPanelpanel=newJPanel();JLabellabel=newJLabel("Digite a senha para iniciar o auxilio:"); JPassword...
asked by 14.07.2016 / 19:17
1
answer

Why, when I change the size of the window, do the drawn components disappear?

I built an application using the windowbuilder of eclipse. In it, when clicking with the mouse, a figure is drawn according to the last button selected. However, when I change the size of the window, all the drawings disappear. After rea...
asked by 12.07.2016 / 14:30
2
answers

JTextField null field validation

On my system, I have a window and a controller, but for some reason, it is never throwing the error, as expected: Method that performs validation: private void validacao(){ if((form.txtNome.getText() != null) && (form.txtEnd.get...
asked by 07.04.2016 / 23:06
3
answers

Toggle Jpanels within a single JFrame

In a Java code, I have a Jframe and inside this JFrame I have a contentPane (Jpanel). I have several screens in JPanel format, I want to swap those JPanels by clicking on a button that is docked inside each Jpanel. By clicking this button, the c...
asked by 04.02.2014 / 15:28
1
answer

Open word file through .jar

I have a .jar calculator that works perfectly! My doubts are: In the menu I have the "Source Code" button and I would like, when clicking, to open a Word document with the source code of the program. I managed to accomplish this task but only on...
asked by 15.05.2014 / 19:40
1
answer

Put icon inside jLabel in a jTextField

How do I change the way the date is inserted into my jTextField ? What I have is the following: IwanttoinsertthisiconthatisinjLabelwithinmyjTextField.Isthispossible?Update:importjava.awt.*;importjavax.swing.*;classTestingextendsJFram...
asked by 13.11.2014 / 12:25
1
answer

Create graphical interface using MigLayout

I need to create this graphical interface: ThelastcodeItriedwasthis:(butthesettingsarenotcorrect)frame.setLayout(newMigLayout("wrap","[grow]","[grow][]")); panelInfo.setLayout(new MigLayout("")); panelInfo.add(new JLabel("tessssssstteeetsss...
asked by 18.12.2014 / 18:24
1
answer

IllegalArgumentException when adding components to JFrame

I'm doing a Sokoban game project, and got to the point where I created 2 JButtons to select the level. Now when I try to run a program a mistake. I created both the buttons and the action in a class Buttons and called it this class in another cl...
asked by 24.06.2018 / 14:02
1
answer

Get Id from an object in the combobox

In a Frame for car registration, I have a combobox1 with car brands and another combobox2 with the models, when I choose a brand in CB1 only appear in CB2 the models related to that brand. Tags and templates are bank tables, which are used by a...
asked by 15.08.2018 / 20:53