zoukankan      html  css  js  c++  java
  • 12.5

    //12.5
     
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.LineBorder;
     
    public class Test extends JFrame
    {
         
        public static void main(String[] args) {
             
            LineBorder lb = new LineBorder(Color.black,2);
            Test t1 = new Test();
            t1.setLayout(new GridLayout(2,2));
            ImageIcon icon1 = new ImageIcon("pic/1.jpg");
            ImageIcon icon2 = new ImageIcon("pic/2.jpg");
            ImageIcon icon3 = new ImageIcon("pic/3.jpg");
            ImageIcon icon4 = new ImageIcon("pic/4.jpg");
            LineBorder lb1 = new LineBorder(Color.black,1);
            JLabel jlb1 = new JLabel(icon1);
            jlb1.setBorder(lb1);
             
            t1.add(jlb1);
            t1.add(new JLabel(icon2)); 
            t1.add(new JLabel(icon3)); 
            t1.add(new JLabel(icon4)); 
            
            
            
            t1.setSize(200,200);
            t1.setDefaultCloseOperation(EXIT_ON_CLOSE);
            t1.setLocationRelativeTo(null);
            t1.setVisible(true);
        }
    }
    

      

  • 相关阅读:
    🍖JS函数
    🍖JS流程控制
    🍖JS运算符介绍
    🍖JS数值类型与字符串类型的内置方法
    多态
    property装饰器
    封装
    组合
    继承&派生 属性查找
    继承与派生
  • 原文地址:https://www.cnblogs.com/wanjiang/p/5549434.html
Copyright © 2011-2022 走看看