NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
~~~ package fuwuqi.view; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Index extends JFrame{ JPanel jp1;//面板 JButton jb1,jb2;//按钮 public static void main(String[] args) { // TODO Auto-generated method stub Index i = new Index(); } public Index(){ jp1=new JPanel(); jb1=new JButton("启动服务器"); jb2=new JButton("关闭服务器"); jp1.add(jb1);jp1.add(jb2); this.add(jp1); this.setSize(186,168); this.setLocation(318, 186); this.setResizable(false); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); } } ~~~ ![](https://box.kancloud.cn/b9292f4c7a9761fab0e530e8bd4408be_191x165.png)