zoukankan      html  css  js  c++  java
  • JAVA:URL之图像图标

     1 //设计图像图标
     2 import javax.swing.*;
     3 import java.awt.*;
     4 public class TestImageIcon extends JFrame
     5 {
     6        private ImageIcon icon1 = new ImageIcon("ToolImages/20.gif");//"ToolImages/20.gif"为该project文件夹下的路劲
     7        private ImageIcon icon2 = new ImageIcon("ToolImages/21.gif");
     8        private ImageIcon icon3 = new ImageIcon("ToolImages/22.gif");
     9        public TestImageIcon()
    10        {
    11            setLayout(new GridLayout(1,3,5,5));
    12            add(new JButton(icon1));
    13            add(new JLabel(icon2));
    14            add(new JButton(icon3));
    15         }
    16         public static void main(String[] agrs)
    17         {
    18             JFrame frame = new TestImageIcon();
    19             frame.setTitle("TestImageIcon");
    20             frame.setLocationRelativeTo(null);
    21             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    22             frame.setSize(500,300);
    23             frame.setVisible(true);
    24         }
    25 }
  • 相关阅读:
    2. 开关电源.电感
    1. 开关电源.引子
    资源介绍
    3. EMC EMS EMI
    2. 基于MCU应用的EMC指南
    1. 内部管脚电路
    9.150 Predefined macros
    海康安防平台
    Redis常见配置
    利用python检测单词的相似度
  • 原文地址:https://www.cnblogs.com/KeenLeung/p/2519106.html
Copyright © 2011-2022 走看看