📄 frame1.java~7~
字号:
package textdataexample;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.dx.dataset.*;import com.borland.dbswing.*;public class Frame1 extends JFrame { JPanel contentPane; JLabel statusBar = new JLabel(); TextDataFile textDataFile1 = new TextDataFile(); TableDataSet tableDataSet1 = new TableDataSet(); Column column1 = new Column(); Column column2 = new Column(); JdbTable jdbTable1 = new JdbTable(); JdbLabel jdbLabel1 = new JdbLabel(); JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar(); TableScrollPane tableScrollPane1 = new TableScrollPane(); TableScrollPane tableScrollPane2 = new TableScrollPane(); //Construct the frame public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(null); this.setSize(new Dimension(400, 300)); this.setTitle("Frame Title"); statusBar.setText(" "); statusBar.setBounds(new Rectangle(0, 284, 400, 16)); textDataFile1.setFileName("F:\\work\\java\\JDBC\\JDBCExampleCode\\TextDataExample\\Test.txt"); textDataFile1.setSeparator(","); tableDataSet1.setDataFile(textDataFile1); column1.setColumnName("my_number"); column1.setDataType(com.borland.dx.dataset.Variant.SHORT); column1.setPreferredOrdinal(0); column1.setServerColumnName("NewColumn1"); column1.setSqlType(0); column2.setCaption("my_string"); column2.setColumnName("my_string"); column2.setDataType(com.borland.dx.dataset.Variant.STRING); column2.setPreferredOrdinal(1); column2.setServerColumnName("NewColumn2"); column2.setSqlType(0); tableDataSet1.setColumns(new Column[] {column1, column2}); jdbTable1.setDataSet(tableDataSet1); jdbTable1.setBounds(new Rectangle(12, 79, 396, 112)); jdbLabel1.setText("jdbLabel1"); jdbLabel1.setBounds(new Rectangle(61, 232, 259, 59)); jdbNavToolBar1.setBounds(new Rectangle(3, 1, 394, 32)); tableScrollPane1.setBounds(new Rectangle(10, 10, 4, 4)); contentPane.add(statusBar, null); contentPane.add(jdbLabel1, null); contentPane.add(jdbNavToolBar1, null); contentPane.add(tableScrollPane1, null); contentPane.add(jdbTable1, null); jdbNavToolBar1.add(tableScrollPane2, null); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -