All Questions
Tagged with swing layout-manager
2,833
questions
1
vote
0
answers
54
views
Best Java Swing layout manager for proportional panes, etc. heights [closed]
I want to keep the proportions for various JPane sizes upon resizing the window (e.g. 10% text box, 90% text pane, etc.) in order for complete consistency. I've been using JSplitPanes as a stopgap, ...
1
vote
2
answers
66
views
Java JSCrollPane won't resize below minimum size of JButton with text
I'm trying put a JPanel (GridLayout 0, 1) with JButtons it, within the ViewPort of a JScrollPane. This is easy enough to do, but it doesn't behave "properly" when resizing the parent JFrame....
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 ...
0
votes
1
answer
25
views
How to draw custom components on a resizeable JPanel with a specific coordinate system?
I'm working on a graph-tree visualizing application. The program could create different layouts for visualizing trees. By tree I mean a Node object which could have a Node as a parent, and a list of ...
1
vote
2
answers
53
views
Rendering properly using GridBagLayout
In the screenshot attached, I have a JLabel, JTextField and a JTabel wrapped in a JSchrollPane. First of all, the JLabel and JTextField are floating so far down in the middle. There is a lot of space ...
0
votes
1
answer
47
views
Problem with aligning component using Java swing and layout managers
I am trying learn java swing. I am having troubles, and I think it is caused by the layout managers, the way I use them.
In the image attached below, you see the JList which is added to the ...
0
votes
1
answer
31
views
How can I position the JLabel and JButton in the center of the gui window in java
I am practicing GUI in java. I am currently struggling with the placement of the elements. I want the JLabel to be in the center middle of the gui window and the button to be right below the JLabel. I ...
0
votes
1
answer
42
views
Layout Manager assistance
I'm trying to make a collapsible panel look and having some issue with the layout manager, I'm pretty new at using layout managers and trying to userstand them. I have Jpanel with a flowlayout, I'm ...
-2
votes
1
answer
41
views
JButtons are not appearing at the West side of the application
When I tried to run my program, it is always an error. The 5 JButtons are not appearing at the west (left) of the MainFrame. I used the BoxLayout for the JButtons so that it can be displayed from top ...
0
votes
0
answers
49
views
How to switch JPanel with buttons on each individual panel?
I'm new to Swing and I'm trying to figure something out. I'm having difficulty explaining what I'm trying to do and I can't find anything online so I wrote a program demonstrating what I want to have ...
0
votes
1
answer
157
views
MigLayout hidemode is not working and cannot hide component
I have been using MigLayout for a while and i never encountered this problem. For some reason the hidemode constraint is not working and i can't make it hide a button.
Here is a code snippet that ...
-1
votes
1
answer
41
views
How to align a JTextField that it is always on the far right side of the window?
I have a normal content pane in Java (IDE: Eclipse) and a JTextField.
Now I want the text field to always be on the far right, even if the size of the window changes. Is this somehow possible?
-1
votes
2
answers
73
views
Managing panels (GridLayout) size in a BorderLayout JFrame
So, i'm making a java battleship game with a GUI from Java Swing. I actually designed the borders (a very initial way) and now i'm trying to make a well-sized board. Consider that the board are the ...
0
votes
1
answer
74
views
How do I get both my image and button to display?
Currently, the problem I am trying to solve is how I get both my image and button to show up.
When I have the following line in the code the image shows up but when I remove it my image doesn't ...
0
votes
1
answer
44
views
Cannot make GridBagLayout contents descend from the top
I have a JFrame with five buttons added to the contents panel.
I intended for the X axis to begin at the very top of the frame, however, when the frame is resized the contents are shifted towards the ...