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 }