Questions tagged [null-layout-manager]

236 questions
-1
votes
1 answer

JPanel cropping or (.setBounds()) not working

Sometimes the setBounds() works but only in the actionlistener. my code: -does not work public panel() { initComponents(); setBounds(100,100,105,105); setMaximumSize(new Dimension(100,100)); } -does work private void…
Emiel Vandenbussche
  • 363
  • 1
  • 5
  • 12
-1
votes
1 answer

How to resize components when resizing a JFrame? Using Null Layout

I am using the NetBeans Designer to create a JFrame. Also it is worth mentioning I am fairly new to Java so I might not understand some things / do things correctly. The frame has about 100 panels, more buttons than I would even think about…
user2399013
  • 75
  • 1
  • 1
  • 6
-2
votes
2 answers

Can't display button

I can't display button and i don't know why Is there any way to fix it I want it to appear at the top in the far left import java.awt.event.*; import java.awt.*; import javax.swing.*; public class test extends JFrame{ JButton b1 = new…
-2
votes
2 answers

Position problem with adding something to JFrame in Java

I want to add JLabels to JFrame directly. I don't want use JPanel. But I have a position problem. I set layout as null. I tryed draw line to see what's going on. @Override public void paint(Graphics g){ g.setColor(Color.red); g.drawLine(0,…
zer0
  • 1
  • 3
-2
votes
1 answer

How To Add JScrollPane Into Jpanel With Null Layout?

Project Snapshot i want to add jscrollpane into my panel to add some more content but it is not working with panel to can any one solve this problem please hurry..... it is not appears in my panel i have tried many times but is it not…
-2
votes
2 answers

The setLocation doesn't move Jlabel even when a layout manager is disabled

I am trying to make the JLabel (point) to move location. It isn't working and when I add frame.setLayout(null) I just get a blank dark screen. JFrame frame = new JFrame( "That snake game"); frame.setLayout(null); …
chickenman
  • 728
  • 2
  • 9
  • 29
-2
votes
2 answers

How to scroll this panel of radio buttons

I am new to swing. I might use a layout manager one day, but please just advise on how I can add a vertical scroll bar to my Frame. I have taken an unorthodox approach, I realize, but I'm learning. I am totally stumped, having read the API. How I…
-2
votes
1 answer

JFrame with null layout not displaying anything

My JFrame with a null layout wont display anything.... I tried adding the components to a JPanel and then set that as the frame's content pane. More recently (as seen in the code below) I tried adding directly to the frame. I am using Java 8. import…
-2
votes
1 answer

ImageIcon by JLabel example with absolute positioning

I have seen a lot of example code but none that specifically shows me how to display an ImageIcon through the use of a JLabel on a JFrame without using a layout manager. I am repeatedly told that absolute positioning is a hassle and less efficient…
-2
votes
1 answer

My JTextField doesn't appear

Here is my java code: JLabel persAdi,persSoyadi,persKodu,ust,alt; JTextField ad,soyad,tckimlikno; JButton bul,iptal; public persBul(){ setSize (400,600); setResizable(false); setLocation (20, 20); …
umitkilic
  • 327
  • 1
  • 4
  • 17
-2
votes
2 answers

Setting a Button's Location In Java

I'm attempting to add a button to my JPanel and set the location. I have buttonOptions.setLocation(1150, 700); but it adds it to the middle of my JPanel, around 600, 20. I tried adding buttonOptions.setLocation(1150, 700); after the adding of the…
MillerTime
  • 55
  • 1
  • 6
1 2 3
15
16