• 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);
        }
    }
    

      

  • 相关阅读:
    react的路由以及传值方法
    三连击
    给网页添加鼠标样式
    单词统计(续)
    个人课程总结
    构建之法阅读笔记02
    构建之法阅读笔记01
    第十六周总结
    计算最长英语单词链
    第十五周总结
  • 原文地址:https://www.cnblogs.com/wanjiang/p/5549434.html
Copyright © 2020-2023  润新知