导航

2016年5月22日

摘要: public class AbsolutePosition extends JFrame{ public AbsolutePosition() { setTitle("本窗口使用绝对布局"); setLayout(null); setBounds(0, 0, 200, 150); Container 阅读全文

posted @ 2016-05-22 18:30 4565892 阅读(193) 评论(0) 推荐(0)

摘要: public class MyImageIcon extends JFrame{ public MyImageIcon() { JFrame jf=new JFrame(); Container container=getContentPane(); JLabel ji=new JLabel("这是 阅读全文

posted @ 2016-05-22 15:48 4565892 阅读(715) 评论(0) 推荐(0)

摘要: class MyJDialog extends JDialog{ public MyJDialog(JFrame frame){ super(frame,"第一个Dialog窗体",true); Container container=getContentPane(); container.add( 阅读全文

posted @ 2016-05-22 15:16 4565892 阅读(289) 评论(0) 推荐(0)

摘要: public class Drawlcon implements Icon{ private int width; private int height; public Drawlcon(int width,int height) { this.width=width; this.height=he 阅读全文

posted @ 2016-05-22 15:16 4565892 阅读(152) 评论(0) 推荐(0)

摘要: 1.JFrame窗体 jf.setSize(200, 150); jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } public static void main(String[] args) { new Example1() 阅读全文

posted @ 2016-05-22 14:38 4565892 阅读(100) 评论(0) 推荐(0)

摘要: 1.原来的AWT组件来自java。awt包,而AWT组件的java应用程序在不同平台的界面显示不同。但是在不同平台运用Swing开发的应用程序,就可以使用同一的GUI界面。 2.SWing组件通常被称为轻量级,它完全由java语言编写。 JButton 按钮 JCheckBox 复选框按钮 JCom 阅读全文

posted @ 2016-05-22 14:10 4565892 阅读(148) 评论(0) 推荐(0)

摘要: 1.非内部类不能被声明为private 或protected访问类型. 阅读全文

posted @ 2016-05-22 13:53 4565892 阅读(117) 评论(1) 推荐(0)

摘要: 1.public class OuterInnerClass extends ClassA.ClassB{ public OuterInnerClass(ClassA a) { a.super(); }}class ClassA{ class ClassB{ } } 说明:在某个类继承内部类时,必须 阅读全文

posted @ 2016-05-22 12:05 4565892 阅读(107) 评论(0) 推荐(0)

摘要: public class StaticInnerClass { int x=100; static class inner{ void doitInner() { System.out.println("外部类+"+x); }//错误的,因为x 不是静态变量,所以在方法中不能用 doitInner方 阅读全文

posted @ 2016-05-22 12:00 4565892 阅读(90) 评论(0) 推荐(0)

摘要: 在方法中定义的内部类,只能访问方法中final 类型的局部变量,这是因为在方法中定义的局部变量相当于一个常量,他的声明周期超出方法运行的声明周期, package com.java.charpt11;interface Outlnterface{//接口一 public void f(); }cla 阅读全文

posted @ 2016-05-22 11:53 4565892 阅读(102) 评论(0) 推荐(0)