Skip to main content

All Questions

Tagged with
0 votes
0 answers
46 views

How to open a new frame when I clicked a button? Is my code a “bad” code? Java GUI Swing

I’m making a frame with numerous buttons inside. public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("Change Name")){ changeNameGUI.setVisible(true); ...
VVV's user avatar
  • 1
0 votes
1 answer
34 views

My components in two different panels are too small and don't fit to the frames size, how can I fix this?

I made a JFrame (size: 500 , 600) that uses GridBagLayout to place two JPanels (one using GridLayout and the other using GridBagLayout) on top of each other; however, when I run my JFrame the ...
user25673196's user avatar
0 votes
1 answer
60 views

Is it possible to connect two different JFrames to one single class?

I make two forms but I have this problem where my second form that will appear after we press a button on the first form could not get the data from the subclass. The plan was I want to only use one ...
Mile's user avatar
  • 1
1 vote
0 answers
43 views

Starting X and sometimes Y coordinate of JFrame is displaced

Just recently started playing around more with Swing and right now I am trying to build an Algorythm Visualiser. The array being displayed is displaced. The starting X coordinate is shifted to the ...
domk's user avatar
  • 19
1 vote
1 answer
70 views

Graphics2d on JPanel

I want to make a program in Java that drops a square at the position of your mouse. For that I wanted to draw a grid as background and then add the squares but as soon as I add a new component to the ...
Wurstbrot's user avatar
0 votes
0 answers
49 views

Issue with object arrays and their usage among frames

I need to find a way to handle the object array to send it to the other frame "Start" I've tried various ways but I can't, I'm just a beginner in the field of OOP, I've tried creating ...
BigDaddyX's user avatar
0 votes
1 answer
36 views

Continue Detecting Input with KeyListener While Typing In a JTextField

I'm currently working on a small utility window for another application and I'm running into the issue that KeyListener input stops detecting input while a user is focused on a JTextField. I've made a ...
ObSp's user avatar
  • 21
0 votes
1 answer
33 views

Making my JLayeredPane background transparent in Java

I would like to stack 3 different 15 × 15 grids filled with JButtons on top of each other where one of them should be visible and the others transparent, but the JButtons should still function and ...
Ahmet Savaseri's user avatar
0 votes
1 answer
36 views

Frame showing up super small Java Swing

could someone tell me why my frame is showing up super small/minimized? I thought I just had to pack my frame to resolve the issue but packing my frame does not seem to have any effect on the outcome. ...
Sofie Chernyak's user avatar
0 votes
0 answers
31 views

Java paintComponent not display background image on JFrame

I am trying to display an image that have in a subdirectory of my project src, and from the testing that I have done, the path reference to utilize the image is correct, however, when I run the ...
Dustin LaRoche's user avatar
0 votes
0 answers
44 views

How to add good quality image to JFrame?

After inserting a good quality image into the JLabel, the final image quality is less detailed (as if it had a lower resolution).original image JFrame screen after inserting. The difference may not be ...
Eugene's user avatar
  • 11
0 votes
0 answers
38 views

repaint() leaves trace of object initial position

I'm implementing a JFrame program that is supposed to mimic balls bouncing with wall & between other balls in a concurrent setting. While the balls are correctly displayed and updated, it leaves ...
Prionantha's user avatar
0 votes
1 answer
58 views

How do I colorize the text in a JFrame Title bar

I have an application controlling hardware that has a JDialog displayed when the user wants 'backdoor' access to the hardware. That JDialog is filled with buttons and features and I don't want to ...
AlexHomeBrew's user avatar
-1 votes
2 answers
43 views

Java : How to display a label inside a Jframe component

I try do display a text at the bottom of the container (JFrame) but it doesn't appear .... import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import ...
Cisco_dev_sn's user avatar
0 votes
1 answer
46 views

Problems with moving an object in Java Swing

I'm having trouble displaying the movement of a custom Jbutton object in Jpanel that has been added to the Jframe. The chart is displayed but when the startMovement method is called the chart ...
Andrea's user avatar
  • 9

15 30 50 per page
1
2 3 4 5
507