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.
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);
Any help or advice will be appreciated. Thanks in advance.
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]);
I think this might solve your problem.