|
查看: 952|回复: 4
|
把你们java的问题post上来
[复制链接]
|
|
|
发表于 28-3-2008 11:15 AM
|
显示全部楼层
Q????
now i got 2 JFrame.
the 1st JFrame i got 1 JButton.
when i click that button it will link to 2nd JFrame or 2nd JFrame will appear...
but the 1st JFrame also at there....
how do i make the 1st JFrame disappear when the 2nd JFrame appaer ....???????
pls.............HELP>>>>>>>
thx thx thx thx |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 28-3-2008 03:18 PM
|
显示全部楼层
原帖由 loychang 于 28-3-2008 11:15 AM 发表 
now i got 2 JFrame.
the 1st JFrame i got 1 JButton.
when i click that button it will link to 2nd JFrame or 2nd JFrame will appear...
but the 1st JFrame also at there....
how do i make the 1st JFra ...
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JPanel;
public class MyFrame extends Frame implements ActionListener {
JButton button = null;
JPanel frame1 = null;
public static void main(String[] args) {
MyFrame mf = new MyFrame();
mf.launchFrame();
}
public void launchFrame() {
frame1 = new JPanel();
frame1.add(getJButton());
frame1.setBackground(Color.red);
JPanel frame2 = new JPanel();
frame2.setBackground(Color.blue);
this.setSize(400, 300);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
this.add(frame1, BorderLayout.NORTH);
this.add(frame2, BorderLayout.CENTER);
this.setVisible(true);
}
public JButton getJButton() {
if (button == null) {
button = new JButton();
button.setText("button 1");
button.addActionListener(this);
}
return button;
}
public void actionPerformed(ActionEvent e) {
frame1.setVisible(false);
}
} |
|
|
|
|
|
|
|
|
|
|
发表于 28-3-2008 11:06 PM
|
显示全部楼层
想在load-balancing的情况下,让几台servers同时接触一个hibernate的cache? |
|
|
|
|
|
|
|
|
|
|
发表于 29-3-2008 10:41 AM
|
显示全部楼层
我也很想学学 load balancing 的东西。。。
因为没那么多架server 所以没试过。。
请问 概念是怎样的? 是不是 一架server 负责route http request
到别架server ? 那么如果 同时 有 100000 个request, 那一架负责这个routing的不是很吃力 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|