佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 952|回复: 4

把你们java的问题post上来

[复制链接]
发表于 28-3-2008 10:01 AM | 显示全部楼层 |阅读模式
把你们java的问题post上来
回复

使用道具 举报


ADVERTISEMENT

发表于 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的不是很吃力
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 1-1-2026 04:43 AM , Processed in 0.133167 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表