|
| ||||||||||
| Tags: awt, java, jpanle, programming language, update |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| JPanle update in java
I am writing a code for java. In the program I have JPanel full of buttons inside a JFrame. Now I want to change the position of the buttons. I tried it by removing them and adding the buttons back, but this is not working any ideas. here is my program. Code: bpanel.removeAll();
for (int i=0; i<9; i++)
{
but[ i ] = new JButton( Names[ i ] );
bpanel.add(but[i]);
}
getContentPane().add(bpanel); |
|
#2
| ||||
| ||||
| Re: JPanle update in java
Hi I think the code you have posted in incomplete. We will require more code so that we can understand what you have really done. Even a small program which can demonstrate your problem will do. Your question is correct, but before going through your code we can not give you the answer. So, it would be better if you post your code so that we can give you reviews for it. |
|
#3
| |||
| |||
| Re: JPanle update in java
Hi I am sorry for that. I have posted my code below. This is my updated code so just go through it and see if you can get some ideas for what I am asking. Code: bpanel.removeAll();
bpanel.getRootPane().revalidate();
for (int i=0; i<9; i++)
{
but[ i ] = new JButton( Names[ i ] );
bpanel.add(but[i]);
}
getContentPane().add(bpanel); |
|
#4
| ||||
| ||||
| Re: JPanle update in java
Hi Your code is just mixed you too much, that is why I thick you are confused. You can change the order by adding them in this way Code: bpanel.add(but[0]); bpanel.add(but[5]); bpanel.add(but[1]); bpanel.add(but[4]); bpanel.add(but[8]); bpanel.add(but[6]); bpanel.add(but[2]); bpanel.add(but[3]); bpanel.add(but[1]);
__________________ The FIFA Manager 2009 PC Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "JPanle update in java" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Not able to uninstall Java TM 6 Update 29 | Yayati | Windows Software | 12 | 11-04-2012 06:49 AM |
| Unable installing Java update | Camillee | Windows Software | 5 | 13-01-2010 02:42 PM |
| Can i delete the old java version update | FeebaAnni | Windows Software | 4 | 24-07-2009 11:03 AM |
| Sun Java JRE 6 Update 14 updated with Win 7 compatibility | Erubiel | Windows x64 Edition | 2 | 29-05-2009 07:52 AM |
| Java update for Windows 64 Bit | supremer | Windows x64 Edition | 3 | 06-09-2005 07:52 PM |