Questions tagged [null-layout-manager]
236 questions
0
votes
0 answers
Eclipse bug doesn't respect the bounds set by GUI
So I've been having this little issue with this app that I'm developing for a school project and I believe my eclipse has bugged out, what happens is, whenever I set the bounds to something on the GUI it doesn't respect them and always puts whatever…
0
votes
1 answer
Why does my GUI disappear as soon as I initialize an ImageIcon?
So i wanna program a Tic Tac Toe game in java.
Now uppon clicking a button, i wanna set the Image of the Button to either "cross" or "circle", but as soon as a type following code, the buttons disappear until i hover over them, then they…

CodeMuffin
- 15
- 4
0
votes
1 answer
JMenuBar doesn't show
I am trying to create a Menubar, but for some reason it doesn't show up. Google research did not help. I put setVisible(true) at the end, I added the Menubar to the window and I added Menupoints into the bar as well. However it still doesn't show…

Leah Fernández
- 31
- 6
0
votes
0 answers
Place a JButton as Image at dedicated location
I am trying to place my JButton which has Image form to a desired place on my JFrame but when I define method setBounds for this particular button it is not working as expected and button is still on the same place. Code below:
public
class…

matri1395
- 1
- 2
0
votes
0 answers
auto resizing the Jcomponents in a Jframe
I am using java swing to create the UI of my application. I want my Jcomponents inside my JFrame to auto-resize as I increase or decrease the size of my JFrame. right now with my code, the application opens up in full screen but when I try to…

Akash RS
- 1
0
votes
0 answers
How to use JScrollPane with JPanel (Null layout)
I have a JButton which generates a JPanel that contains a set of JLabel components. As you can see, the amount of labels can be a bit too much for 600x600 frame to hold. I tried adding JScrollPane, but nothing works for some reason. Changing layout…

ZandD
- 1
0
votes
1 answer
JLabel not showing in java at the start of program
So I'm trying to create a simple game in java for practice and i keep encountering a problem.
The first JLabel(text) that should appear on the program isn't showing and I don't know what to do. I hope it doesn't have to do with the other JLabels…

biskyy
- 17
- 4
0
votes
0 answers
How to add a JScrollPanel to previously added label components?
I'm having a little problem when
trying to add JScrollPanel to previously added components
with their bounds set specificaly in the for loop. The problem begins when I wanna add more than 15 components in my frame because I've explicitly set frame…
0
votes
1 answer
Null Layout not showing over Border Layout in Java
Greeting of the day, I have a JFrame and a Jpanel named panelMain. all my set-up for both the frame and panel are perfect. I have set the Layout of panelMain to BorderLayout. I have now created another panel named panel1. panel1 has a null layout. I…
user14253240
0
votes
1 answer
jsplitpane and paintcomponent conflicting with each other
I'm having issues with my code regarding the fact that when I instantiate my City class as an object and add it to the right side of my JSplitPane (or even the left), the circle that is supposed to be drawn is not showing up. My cities class uses…

SteamedBun
- 91
- 9
0
votes
0 answers
Absolute positioning Swing(Java) not working
I am trying to position something using absolute positioning, and for some reason when I run my code the window that previously worked, shows nothing.
This is the code that I have which works:
public LoginScreen() {
window = new JFrame();
…

YaBoyIsFat
- 9
- 2
0
votes
0 answers
why does the JTextField go beyond the border of the JFrame?
Good evening.
I'm having a strange problem with the JTextField in my gui for a calculator.
in few word the Text field goes beyond the border of the frame (which is 500), the strange thing is that i've set the lenght bound of the text field as the…

LION
- 1
0
votes
1 answer
How to add JPanel to JScrollPane?
I have added one JPanel to the JScrollPane. But the main panel is not scrolling. My problem is like this:
JPanel MainPanel = new JPanel();
MainPanel.setBounds(width/2,height/10,width/5,height/5);
MainPanel.setLayout(null);
JScrollPane scrollPane=…

Harshad201
- 53
- 2
- 8
0
votes
1 answer
Java Swing Responsive Absolute Positioning
I am newby to java swing gui and I cannot figure out this problem
Lets assume I Have a Jframe size 100,100 I have 4 button positions
left top widht height
button1 0 0 10 10 // left up
button2 90 0 10 10 // right up
button3…

Tekin Güllü
- 363
- 1
- 3
- 18
0
votes
1 answer
setLayout(null) JTextField size
I'm currently working on a small project that requires "null" layout of my JPanel.
When adding or editing a JTextField, is there any other way for me to have it visible without having to setBounds()?
What I want is for the height and width to be…

Freebmdplz
- 1
- 1