📄 frame1.java~71~
字号:
package english;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.Color;
import java.awt.GridBagLayout;
import java.awt.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.borland.dx.sql.dataset.Database;
import com.borland.dx.sql.dataset.ConnectionDescriptor;
public class Frame1 extends JFrame {
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
JToolBar jToolBar = new JToolBar();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
ImageIcon image1 = new ImageIcon(english.Frame1.class.getResource(
"openFile.png"));
ImageIcon image2 = new ImageIcon(english.Frame1.class.getResource(
"closeFile.png"));
ImageIcon image3 = new ImageIcon(english.Frame1.class.getResource(
"help.png"));
JTabbedPane jTabbedPane1 = new JTabbedPane();
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
JPanel jPanel4 = new JPanel();
JPanel jPanel5 = new JPanel();
BorderLayout borderLayout2 = new BorderLayout();
BorderLayout borderLayout3 = new BorderLayout();
BorderLayout borderLayout4 = new BorderLayout();
BorderLayout borderLayout5 = new BorderLayout();
BorderLayout borderLayout6 = new BorderLayout();
JPanel jPanel6 = new JPanel();
JEditorPane jEditorPane1 = new JEditorPane();
JScrollPane jScrollPane1 = new JScrollPane(jEditorPane1,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
JPanel jPanel7 = new JPanel();
JEditorPane jEditorPane2 = new JEditorPane();
JScrollPane jScrollPane2 = new JScrollPane(jEditorPane2,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
JPanel jPanel8 = new JPanel();
JEditorPane jEditorPane3 = new JEditorPane();
JScrollPane jScrollPane3 = new JScrollPane(jEditorPane3,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
JPanel jPanel9 = new JPanel();
JEditorPane jEditorPane4 = new JEditorPane();
JScrollPane jScrollPane4 = new JScrollPane(jEditorPane4,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
JPanel jPanel10 = new JPanel();
JEditorPane jEditorPane5 = new JEditorPane();
JScrollPane jScrollPane5 = new JScrollPane(jEditorPane5,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
XYLayout xYLayout1 = new XYLayout();
JPanel jPanel11 = new JPanel();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
XYLayout xYLayout2 = new XYLayout();
XYLayout xYLayout3 = new XYLayout();
JPanel jPanel12 = new JPanel();
XYLayout xYLayout4 = new XYLayout();
JButton jButton6 = new JButton();
JButton jButton7 = new JButton();
XYLayout xYLayout5 = new XYLayout();
JPanel jPanel13 = new JPanel();
JButton jButton8 = new JButton();
JButton jButton9 = new JButton();
XYLayout xYLayout6 = new XYLayout();
XYLayout xYLayout7 = new XYLayout();
JPanel jPanel14 = new JPanel();
JButton jButton10 = new JButton();
JButton jButton11 = new JButton();
XYLayout xYLayout8 = new XYLayout();
XYLayout xYLayout9 = new XYLayout();
JPanel jPanel15 = new JPanel();
JButton jButton12 = new JButton();
JButton jButton13 = new JButton();
XYLayout xYLayout10 = new XYLayout();
Database database1 = new Database();
public Frame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(borderLayout1);
setSize(new Dimension(400, 300));
setTitle("懒人学英语");
jButton1.setIcon(image1);
jButton1.setToolTipText("Open File");
jButton2.setIcon(image2);
jButton2.setToolTipText("Close File");
jButton3.setIcon(image3);
jButton3.setToolTipText("Help");
jPanel2.setLayout(borderLayout3);
jPanel1.setLayout(borderLayout2);
jPanel2.setLayout(borderLayout3);
jPanel3.setLayout(borderLayout4);
jPanel4.setLayout(borderLayout5);
jPanel5.setLayout(borderLayout6);
jEditorPane1.setPreferredSize(new Dimension(300, 50));
jEditorPane1.setText("jEditorPane1");
jEditorPane2.setPreferredSize(new Dimension(340, 50));
jEditorPane2.setText("jEditorPane2");
jEditorPane3.setPreferredSize(new Dimension(340, 50));
jEditorPane3.setText("jEditorPane3");
jEditorPane4.setPreferredSize(new Dimension(340, 50));
jEditorPane4.setText("jEditorPane4");
jEditorPane5.setPreferredSize(new Dimension(340, 50));
jEditorPane5.setText("jEditorPane5");
jPanel6.setLayout(xYLayout1);
jButton4.setText("重置");
jButton5.setText("保存");
jPanel11.setLayout(xYLayout2);
jPanel7.setLayout(xYLayout3);
jPanel12.setLayout(xYLayout4);
jButton6.setText("保存");
jButton7.setText("重置");
jPanel8.setLayout(xYLayout5);
jButton8.setText("重置");
jButton9.setText("保存");
jPanel13.setLayout(xYLayout6);
jPanel9.setLayout(xYLayout7);
jButton10.setText("重置");
jButton11.setText("保存");
jPanel14.setLayout(xYLayout8);
jPanel10.setLayout(xYLayout9);
jButton12.setText("重置");
jButton13.setText("保存");
jPanel15.setLayout(xYLayout10);
jScrollPane3.setPreferredSize(new Dimension(319, 69));
database1.setConnection(new ConnectionDescriptor("jdbc:odbc:english",
"sa", "", false, "sun.jdbc.odbc.JdbcOdbcDriver"));
jToolBar.add(jButton1);
jToolBar.add(jButton2);
jToolBar.add(jButton3);
contentPane.add(jTabbedPane1, java.awt.BorderLayout.CENTER);
contentPane.add(jToolBar, BorderLayout.NORTH);
jTabbedPane1.add(jPanel1, "口语练习");
jPanel1.add(jPanel6, java.awt.BorderLayout.SOUTH);
jTabbedPane1.add(jPanel2, "成语故事");
jPanel2.add(jPanel7, java.awt.BorderLayout.SOUTH);
jTabbedPane1.add(jPanel3, "词语接龙");
jScrollPane3.getViewport().add(jEditorPane3);
jTabbedPane1.add(jPanel4, "歌曲点播");
jPanel4.add(jPanel9, java.awt.BorderLayout.SOUTH);
jScrollPane4.getViewport().add(jEditorPane4);
jTabbedPane1.add(jPanel5, "配音秀");
jPanel5.add(jPanel10, java.awt.BorderLayout.SOUTH);
jPanel3.add(jPanel8, java.awt.BorderLayout.SOUTH);
jScrollPane5.getViewport().add(jEditorPane5);
jScrollPane2.getViewport().add(jEditorPane2);
jScrollPane1.getViewport().add(jEditorPane1);
jPanel7.add(jScrollPane2, new XYConstraints(2, 0, 312, 76));
jPanel6.add(jScrollPane1, new XYConstraints(4, 0, 312, 79));
jPanel6.add(jPanel11, new XYConstraints(321, 7, -1, 63));
jPanel11.add(jButton4, new XYConstraints(7, 31, 61, 30));
jPanel7.add(jPanel12, new XYConstraints(321, 4, 66, 68));
jPanel12.add(jButton6, new XYConstraints(4, 0, 62, 31));
jPanel12.add(jButton7, new XYConstraints(5, 37, 62, 29));
jPanel13.add(jButton9, new XYConstraints(8, 6, 63, 29));
jPanel13.add(jButton8, new XYConstraints(9, 39, 62, 31));
jPanel8.add(jPanel13, new XYConstraints(318, 1, 73, 72));
jPanel8.add(jScrollPane3, new XYConstraints(3, 3, 310, 75));
jPanel9.add(jPanel14, new XYConstraints(315, 5, 78, 68));
jPanel14.add(jButton11, new XYConstraints(9, 2, 61, 29));
jPanel14.add(jButton10, new XYConstraints(11, 40, 59, 29));
jPanel9.add(jScrollPane4, new XYConstraints(4, 0, 305, 84));
jPanel15.add(jButton13, new XYConstraints(10, 3, 64, 29));
jPanel10.add(jScrollPane5, new XYConstraints(5, 0, 298, 87));
jPanel10.add(jPanel15, new XYConstraints(314, 0, 76, 80));
jPanel15.add(jButton12, new XYConstraints(12, 42, 60, 28));
jPanel11.add(jButton5, new XYConstraints(5, 2, 60, 27));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -