Things have been delayed so I'm learning something new these days. And then a little bit of a win. The skull is not good, I am writing a hospital procedure these days. It's all just superficial. There is no foundation but to bite. But these days are still possible. It's a little rewarding.
Today we are talking about a for loop. I'm still trying for the For loop this afternoon. Finally got it out.
static void Addwidget2jpaneltoppanel (JPanel toppanel) {
For Loop Addend Group
String[] strarray={"e:/imgicon/picture/png/001.png", "e:/imgicon/picture/png/002.png", "e:/imgicon/picture/png/003.png"};
for (int i=1;i<strarray.length;i=i+1) {
ImageIcon icon=new ImageIcon (Strarray[i]);
JButton t1=new JButton (icon);
Toppanel.add (t1);
}
The thing to note here is the amount (i<strarray.length) which means that you define how long a string[]strarray is. No more, no less.
Then there is the aspect of the transformation. After all, this is a picture converted into a button. So to assign values,
Assign the value of I to ImageIcon
The resulting JButton assigns the value of ImageIcon to JButton t1. So t1 with a buff.
At the end of the display where the display is displayed,
Layout Manager I don't understand, so I'm not too good to say
Is that the layout manager is divided by the default with the buff.
The default seems to be all borderlayout.
You can then set the content from left to right . --". SetLayout (New FlowLayout (flowlayou. left));
Spoke of the JSplitPane division
jtabbadpane--"This is what this means. Is the form of a folder.
Now do a lot of feeling thinking is: In the window you want to create a new jpanel on the window to show up. Then add the methods, controls in the JPanel. And then it's displayed. Is the big one is divided into small. Then put the small into the big Show out. Then it's better not to be too thin. Otherwise it will be cumbersome. However, we still have to follow the actual situation!
Java Eighth Day