Questions tagged as 'jframe'

2
answers

Close all open jframes when opening a new one

How can I close all open jframes in my project when I execute an action that opens another jframe? I have a login system and when needed, I invoke another frame to set a password. After setting the password I make the dispose () to this jfram...
asked by 09.12.2014 / 16:09
1
answer

Create JLabel below image

I created a JPanel of 672x750 and placed a 672x672 image inside it. I need to put texts under the image, in the space left over. Is there any way to create a JLabel and position it below the image? I've tried, but they take up all the space avai...
asked by 24.07.2016 / 18:21
1
answer

Calling an ArrayList from one JFrame to another

I need to call a ArrayList created in JFrame to another JFrame . In this case, the user would make a record in one of the JFrames, called Cadastre, and from this would create the User object, with login and password and this...
asked by 18.10.2015 / 04:20
1
answer

How to maintain the layout of components created by WindowBuilder in eclipse after compilation?

I created a JFrame using the Eclipse WindowBuilder plugin. Spacings, sizes and patterns were defined. However when compiling the project the standards are lost. Below the 2 photos for comparison. Here is the JFrame Preview. JFrameaftercomp...
asked by 25.03.2015 / 13:20
1
answer

How to get the color of a pixel on the screen in JAVA 2D game?

Is there any way to get the color of a pixel at the x and y coordinates of the screen that I specify?     
asked by 15.06.2014 / 00:05
2
answers

How to automatically adjust a JFrame to screen size?

I have a program and when I run on different computers the window gets completely undone and you can not see the components you have in Jframe, I would like to know if there is any way the window can be automatically adjusted to the screen of th...
asked by 08.11.2014 / 23:07
1
answer

Close window when clicking JButton

Is it possible to click on a button and JFrame to be closed as if I had clicked on the X of the window? If it is possible, how do I create it? What I've already studied is using ActionListener but I can not find the code to clos...
asked by 14.11.2017 / 01:37
1
answer

How to change border color and JFrame title in Java?

I would like to know how to change the border color and title of a JFrame in Java. I only found information on how to remove the border and title, but how to change the color does not. I'm currently using Eclipse.     
asked by 16.09.2018 / 04:49
1
answer

Capturing action of certain buttons in a JFrame

I created a JFrame that, when clicking the keyboard buttons: up, down, left and right, a certain action should take place (a Joption in the case). For this I am using a KeyListener , but unfortunately I click on certain buttons a...
asked by 20.06.2017 / 00:46
1
answer

How do I initialize the centralized JFrame?

I have tried this.setLocationRelativeTo(null); only that he was not in the middle of the screen, I would say he was much more right and down than in the center. public Principal() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.s...
asked by 25.03.2016 / 02:06