Ask Experts Questions for FREE Help !
Ask
    masterawai's Avatar
    masterawai Posts: 1, Reputation: 1
    New Member
     
    #1

    Dec 4, 2013, 12:15 PM
    Change the position of button in java
    I need to change the button position in java. How I can do it?

    here is my code

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    getContentPane().setBackground(new Color(153,204,255));
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(154, 154, 154)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.LEADING, false)
    .addComponent(diverButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(printReportButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(quitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addGroup(layout.createSequentialGroup()
    .addGap(53, 53, 53)
    .addComponent(jLabel1)))
    .addContainerGap(63, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(34, 34, 34)
    .addComponent(jLabel1)
    .addGap(45, 45, 45)
    .addComponent(diverButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(34, 34, 34)
    .addComponent(printReportButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(30, 30, 30)
    .addComponent(quitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(35, Short.MAX_VALUE))
    );

    pack();
    setLocationRelativeTo(null);

Check out some similar questions!

How can Java change 12/4 to 3/1 and so on? [ 0 Answers ]

So I made a script for school where 2 numbers get divided but when I get a 12/4 for example I want to make it to 3/1 to make it easier to read. Thanks

How can I change voice/frequency/sound format in java ? [ 0 Answers ]

I have a mp3 file and I can play this using java. But I want to change it's frequency and then want to play. Actually I want to change a song's voice like a song is in a women voice and I want to play it in a baby or a cat voice. As I am a new java programmer ,so please help me in a brief way.

Should I change the sleeping position [ 1 Answers ]

I am in 32nd week of pregnancy. I have read in internet that sleeping on the left side is the best position. But I sometimes feel baby's movement on the same side. So I am worried whether it will cause any harm to my baby if I continue sleeping in the same position Or should I need to change the...

Hansa smart shower button does not lock in position [ 1 Answers ]

I have a problem with Hansa smartshower, the button which diverts the water to the tube does not lock and I need to keep pressing. Any ideas what the reason might be and how to fix it? Grateful for any advice!

1997 chevy cav. Crankshaft position sensor change [ 1 Answers ]

Can we see a diagram that would help with this?


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.