All Questions
Tagged with components swing
52 questions with no upvoted or accepted answers
3
votes
0
answers
1k
views
Java - Wait for component to be shown
UPDATE #3: After madProgrammer's suggestions, maybe the timed solution is the best. But no answer has been given to this strange behaviour.
I understand the fact that components are not shown ...
2
votes
1
answer
1k
views
clarification on inheritance hierarchy for the component class in Java Swing?
I am reading Core Java Volume 1 on Swing. I am having difficulty understanding this paragraph:
Firstly, the author says
Components can be placed inside containers such as panels. Container
can ...
1
vote
0
answers
50
views
GridBagLayout components change when JFrame is undecorated
I am using a GridBagLayout (3x1) to display the login screen for a program I am making. The layout and everything in it looks fine and how it is suppose to when the JFrame is decorated. Everything ...
1
vote
0
answers
135
views
Java - In terms of performance when handling Swing component views. Is it better to hide the component or just remove the component altogether?
I am implementing a simple Java Desktop application that has a main panel where any of the views chosen by the user from the menu will be loaded. Currently, I am accomplishing this by removing the ...
1
vote
0
answers
301
views
Repaint after moving component
At the beginning I'd like to stress, that I'm quite new to Java and I always try to find the answer for my questions myself, but sometimes it happens that I reach the dead-end and that's why I'd like ...
1
vote
0
answers
388
views
Adding Swing components to a LibGDX screen
As opposed to most questions I have seen where people are trying to add a LibGDX canvas to a JFrame or similar, I am trying for the opposite.
I have been working on a LibGDX game that utilises a ...
1
vote
0
answers
1k
views
Get all values from jtextfield in jpanel
I can values all jtextfield in jpanel. but values are disordered. How i get order by jtextfield position.
I use follow sample code:
private void all(Container container) {
for (Component c : ...
1
vote
2
answers
119
views
Component passed to constructor doesn't display
I've created a class that creates a panel, and in the constructor I'm passing a button with an action listener attached.
This is the code for the button:
JButton back = new JButton("Back");
back....
1
vote
0
answers
242
views
Wrong Mouselistener fires
I made a program in Java in which you can draw Ellipses and Rectangles, then later group them to do Resizes and Move actions on them.
I add MouseListeners to both the DrawPanel(JPanel) as all the ...
1
vote
1
answer
304
views
I can't display my JPanel components when I change it on a JFrame
I can't seem to display my components of my panel onto the frame. Can someone please assist?
I just gives me a blank JFrame. No more components on it.
import javax.swing.JPanel;
/*
* To change ...
1
vote
1
answer
89
views
How to change which Component is listening for events
I'm trying to cycle between buttons programmatically, so I need to be able to change which button is listening for events when I move right/left or up/down.
I have tried button.setSelection(true); ...
1
vote
0
answers
413
views
Synthetica & Synthetica Addons
I am looking into getting Synthetica and Synthetica Addons. I am really interested in the Addons for better JTable filtering, sorting, and customization ability. Per the demos they seem to have done ...
1
vote
2
answers
1k
views
JFrame Menu's being drawn over and Graphics disappearing upon JFrame Resize
I am a high school student, and I am working on my final project for my computer science class. My assignment was to make a simple paint application, however I am having some problems. These include: ...
0
votes
1
answer
25
views
Get the variable associated with a JPanel component from a component array
Say I have a JPanel with buttons (and other things) as components and I make an array of those components as such:
JPanel panel = new JPanel();
JButton btn1 = new JButton();
JButton btn2 = new ...
0
votes
0
answers
34
views
Custom popup don't always get focus
I try to basically implement my own combobox for Swing, because JComboBox has some behavior that doesn't suit my requirements and what I need to override is private, so...
Anyway, I tried making a ...