⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 step1_frame.java

📁 《JAVA网络编程实例》源代码
💻 JAVA
字号:
import java.awt.*;import java.awt.event.*;/** * File:        step1_Frame.java * 按照转乘方式查寻,交互操作的第一步的界面和处理代码 */public class step1_Frame extends Frame {  public String mystat1=new String("");  public String mystat2=new String("");  Button button1 = new Button();  Label label1 = new Label();  Button button2 = new Button();  public step1_Frame(String userinfo) {    this.setSize(400,300);    try {      jbInit();      this.label1.setText(userinfo);    }    catch(Exception e) {      e.printStackTrace();    }  }  private void jbInit() throws Exception {    button1.setLabel("取消");    button1.setBounds(new Rectangle(197, 178, 80, 23));    button1.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        button1_actionPerformed(e);      }    });    this.setLayout(null);    label1.setText("msg");    label1.setBounds(new Rectangle(24, 24, 260, 55));    this.setVisible(true);    this.setTitle("北京市区公交查寻系统——用户信息");    this.setResizable(false);    button2.setLabel("下一步");    button2.setBounds(new Rectangle(45, 179, 80, 23));    button2.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        button2_actionPerformed(e);      }    });    this.add(label1, null);    this.add(button2, null);    this.add(button1, null);  }  void button1_actionPerformed(ActionEvent e) {    this.hide();  }  void button2_actionPerformed(ActionEvent e) {    //当用户点击下一步之后进入转乘查寻界面    step2_Frame f2=new step2_Frame();    f2.mystat1=this.mystat1;    f2.mystat2=this.mystat2;    f2.user_mystat1.setText(this.mystat1);    f2.user_mystat2.setText(this.mystat2);    f2.show();    this.hide();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -