zoukankan      html  css  js  c++  java
  • java 实现滚动条

     1 package test;
    2
    3 import java.awt.Container;
    4 import java.awt.Font;
    5 import java.io.File;
    6 import java.util.EmptyStackException;
    7 import java.util.Iterator;
    8 import java.util.Stack;
    9
    10 import javax.swing.Icon;
    11 import javax.swing.ImageIcon;
    12 import javax.swing.JButton;
    13 import javax.swing.JFrame;
    14 import javax.swing.JLabel;
    15 import javax.swing.JPanel;
    16 import javax.swing.JScrollPane;
    17 import javax.swing.JSpinner;
    18 import javax.swing.JSplitPane;
    19 import javax.swing.JTabbedPane;
    20
    21 public class ImplementsDemo {
    22 public static void main(String[] args) throws EmptyStackException{
    23 JFrame f=new JFrame("Welcome To Earth!");
    24 Container cont=f.getContentPane();
    25 String picPath="c:"+File.separator+"Users"+File.separator+"Sunboy"+File.separator+"desktop"+File.separator+"课表.png";
    26 Icon ico=new ImageIcon(picPath);
    27 JPanel pan=new JPanel();
    28 JLabel lab=new JLabel(ico);
    29 pan.add(lab);
    30 JScrollPane scr1=new JScrollPane(pan, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    31 cont.add(scr1);
    32 f.setSize(1280,720);
    33 f.setLocation(300, 200);
    34 f.setVisible(true);
    35
    36 }
    37
    38 }
  • 相关阅读:
    2.1 maven配置多镜像地址
    6.4 SpringData JPA的使用
    4.3 thymeleaf模板引擎的使用
    java面试题整理
    eclipse配置运行时变量
    postman上传文件
    Python定义字符串、循环
    Charles抓包
    jmeter压测
    JMeter,postman
  • 原文地址:https://www.cnblogs.com/dennisac/p/2435289.html
Copyright © 2011-2022 走看看