Java中不同包之间的调用实现

来源:互联网 发布:淘宝售前客服工作职责 编辑:程序博客网 时间:2024/05/16 23:54
package Test1;//用于调用Test2包import Test2.*;import java.awt.*;import javax.swing.*;public class APP extends JFrame{public static void main(String[] args) {// TODO Auto-generated method stubAPP a = new APP();}public APP(){new Members();}}
package Test2;import javax.swing.Icon;import javax.swing.ImageIcon;import javax.swing.JFrame;import javax.swing.JLabel;public class Members extends JFrame{public Members(){//设置整个窗体setForm();}private void setForm(){//设置窗体为自由布局setLayout(null);this.setTitle("推箱子小游戏");this.setSize(800, 600);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setLocationRelativeTo(null);this.setVisible(true);}}


0 0
原创粉丝点击