📄 mainpane.java
字号:
import java.awt.*;
import java.awt.Component;
import java.awt.Window;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.*;
import javax.swing.border.*;
public class MainPane extends JPanel
{
protected Component menubar;
protected JToolBar toolbar;
protected Component statusbar;
protected JPanel contentPanel;
public MainPane()
{
super();
initialize();
}
public JMenuBar getMenubar(JFrame frame) {
JMenuBar menuBar = new SystemMenu(frame).createMenuBar();
return menuBar;
}
/**
* Initialize the JApplication.
*/
protected void initialize( ) {
setBorder(BorderFactory.createEtchedBorder());
setLayout(new BorderLayout());
System.out.println("JApplication initalize 3b");
showStartupStatus("Initializing Context Panel");
System.out.println("JApplication initalize 3c");
initializeContentPanel();
System.out.println("JApplication initalize 4");
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout());
//mainPanel.add("North",toolbar = getToolbar());
mainPanel.add("Center", contentPanel);
JStatusBar statusbar = new JStatusBar();
statusbar.setPreferredSize(new Dimension(10,20));
statusbar.setBorder(BorderFactory.createEtchedBorder());
mainPanel.add("South", statusbar);
// add("North", menubar = getMenubar());
add("Center", mainPanel);
}
/**
* Initialize the contentPanel. The contentPanel will contain
* other panels that define the content of the application.
*/
protected void initializeContentPanel( )
{
contentPanel = new JPanel();
contentPanel.setLayout(new BorderLayout());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -