java图形界面源码,java图形用户界面

1,java图形用户界面图标是指改变左上角的那个咖啡杯?。炕故怯蚁陆桥鐾信贪 。浚康谝桓霰冉霞虻? ,换个图片就行 。第二个吗,有个专门的类能解决 。老大,这些属性都是JFrame的默认值吧,不明白其中的可变成图标什么意思?莫非是传说中的最小化?import javax.swing.*;class MyFrame extends JFrame{ JLable msg; MyFrame(){ super("你要的是这种东西?"); this.setBounds(100,100,100,100); msg=new JLabel("莫非这是你要的东西?"); this.add(msg,BorderLayout.CENTER); //this.add(msg); this.setVisible(true); } public static void main(String [] args){ new MyFrame(); } }
2 , 用java做个AWT图形用户界面代码import java.awt.*;import java.applet.Applet;public class KY6_1 extends Applet {Label l1;Button b1, b2, b3, b4, b5, b6;public void init() {setLayout(new GridLayout(3,3)); // 设置网格布局(3 行3 列共9 个网格)l1=new Label("标签1");b1 = new Button("按钮1");b2 = new Button("按钮2");b3 = new Button("按钮3");b4 = new Button("按钮4");add(l1);add(b1);add(b2);add(b3);add(new Label());add(b4);add(new Button("按钮5"));add( new Button("按钮6"));add(new Label("标签2"));}}
3,给个JAVA图形界面基础的准代码import java.awt.GridLayout;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JTextField;public class Test extends JFrame JLabel l_username; JLabel l_password; JTextField t_username; JTextField t_password; JButton confirm; JButton cancel; public static void main(String[] args)new Test(); } public Test() init(); } private void init() l_username=new JLabel("用户名:"); l_password=new JLabel("密码:"); t_username=new JTextField(); t_password=new JTextField(); confirm=new JButton("确认"); cancel=new JButton("取消"); this.setLayout(new GridLayout(3, 2)); this.add(l_username); this.add(t_username); this.add(l_password); this.add(t_password); this.add(confirm); this.add(cancel); this.pack(); this.setLocation(300, 200); this.setVisible(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }呵呵 , 希望符合你的要求【java图形界面源码,java图形用户界面】

    推荐阅读