📄 tester.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
// Set this file as main (choose it in the
// project window, then press F5) to run the
// application version.
public class Tester
{
public final static Border emptyBorder5 = new EmptyBorder(5,5,5,5);
public final static Border etchedBorder5 = new CompoundBorder(new EtchedBorder(),emptyBorder5);
public static void main(String args[])
{
String vers = System.getProperty("java.version");
if (vers.compareTo("1.1.2") < 0) {
System.out.println("!!!WARNING: FreeJava Help must be run with a " +
"1.1.2 or higher version VM!!!");
System.exit(0);
}
JLabel label = new JLabel("Starting FreeJava Help", JLabel.CENTER);
MainFrame miniframe = new MainFrame("Starting FreeJava Help");
miniframe.getContentPane().add(label, "Center");
centerFrame(miniframe,240,180);
miniframe.show();
ImageIcon icon = new ImageIcon("helpfiles/freejava1.gif");
MainFrame f = new MainFrame("FreeJava Help");
HtmlPanel rightPanel = new HtmlPanel("helpfiles/home.html");
ImageIcon helpicon = new ImageIcon("helpicon.gif");
f.setIconImage(helpicon.getImage());
JPanel p = new JPanel();
p.setBorder(etchedBorder5);
p.setLayout(new BorderLayout());
p.add(new JLabel(icon), "North");
p.add(new IndexPanel("helpfiles/index.html",rightPanel), "Center");
f.getContentPane().add(p, "West");
f.getContentPane().add(rightPanel, "Center");
centerFrame(f, 640,480);
f.show();
miniframe.dispose();
}
static void centerFrame(JFrame frame, int width, int height)
{
frame.setSize(width, height);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(screenSize.width/2 - width/2,
screenSize.height/2 - height/2);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -