📄 frame1.java~10~
字号:
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(); JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar(); JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel(); TableScrollPane tableScrollPane1 = new TableScrollPane(); JdbTable jdbTable1 = new JdbTable(); //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.setWidth(5); 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.setWidth(40); column2.setServerColumnName("NewColumn2"); column2.setSqlType(0); tableDataSet1.setColumns(new Column[] {column1, column2}); jdbNavToolBar1.setBounds(new Rectangle(3, 1, 394, 32)); jdbStatusLabel1.setText("jdbStatusLabel1"); jdbStatusLabel1.setBounds(new Rectangle(101, 256, 167, 38)); tableScrollPane1.setBounds(new Rectangle(11, 46, 376, 181)); jdbTable1.setDataSet(tableDataSet1); contentPane.add(statusBar, null); contentPane.add(jdbNavToolBar1, null); contentPane.add(jdbStatusLabel1, null); contentPane.add(tableScrollPane1, null); tableScrollPane1.getViewport().add(jdbTable1, 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 + -