日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

eclipse java shell 窗体显示 bat运行不显示_java eclipse中如何实现点击主窗口sShell中的按钮打开另外一个子窗口sShell...

發布時間:2025/4/16 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 eclipse java shell 窗体显示 bat运行不显示_java eclipse中如何实现点击主窗口sShell中的按钮打开另外一个子窗口sShell... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

java eclipse中如何實現點擊主窗口sShell中的按鈕打開另外一個子窗口sShell

關注:97??答案:2??mip版

解決時間 2021-01-31 13:01

提問者╬═掵中注定

2021-01-31 01:34

java eclipse中如何實現點擊主窗口sShell中的按鈕打開另外一個子窗口sShell

最佳答案

二級知識專家小河邊唱歌

2021-01-31 02:09

import java.awt.*;

import java.awt.event.*;

import javax.swing.AbstractButton;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JTextField;

public class button extends JFrame{

public button(){

JButton button=new JButton("查找");

setLayout(new FlowLayout());

add(button);

button.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e){

selectinterface sl = new selectinterface();

sl.setVisible(true);

sl.pack();

}

});

}

public static void main(String[] args) {

// TODO Auto-generated method stub

button frame=new button();

frame.setTitle("按鈕");

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setSize(400,600);

frame.setVisible(true);

}

}

class selectinterface extends JFrame{

public selectinterface(){

JPanel p1=new JPanel();

p1.setLayout(new GridLayout(9,2,5,5));

p1.add(new JLabel("編號"));

p1.add(new JTextField(6));

p1.add(new JLabel("姓名"));

p1.add(new JTextField(8));

p1.add(new JLabel("性別"));

p1.add(new JTextField(1));

p1.add(new JLabel("年齡"));

p1.add(new JTextField(2));

p1.add(new JLabel("職位"));

p1.add(new JTextField(20));

p1.add(new JLabel("學歷"));

p1.add(new JTextField(4));

p1.add(new JLabel("學位"));

p1.add(new JTextField(4));

p1.add(new JLabel("工齡"));

p1.add(new JTextField(2));

p1.add(new JLabel("工資等級"));

p1.add(new JTextField(2));

JPanel p2=new JPanel();

p2.add(new JButton("確定"));

p2.add(new JButton("取消"));

setLayout(new GridLayout(2,1,0,100));

add(p1);

add(p2);

}

}

全部回答

1樓看厭了山川

2021-01-31 03:39

先用eclipse的界面設計器設計好你要用的兩個界面

然后在主界面的一個button上添加一個單擊事件在事件的處理代碼中產生一個界面2的類并且將該對象的可視化屬性設置為可見即可

我要舉報

如以上問答內容為低俗/色情/暴力/不良/侵權的信息,可以點下面鏈接進行舉報,我們會做出相應處理,感謝你的支持!

→點此我要舉報以上信息!←

推薦資訊

大家都在看

總結

以上是生活随笔為你收集整理的eclipse java shell 窗体显示 bat运行不显示_java eclipse中如何实现点击主窗口sShell中的按钮打开另外一个子窗口sShell...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。