Database application development is a feature of JBuilder Professional and Enterprise. Distributed application development is a feature of JBuilder Enterprise.
You can use the JBuilder visual design tools to add DataExpress
components to your application. The visual design tools are available on the Design tab in the content pane.
You add DataExpress
components by clicking them on the DataExpress tab of the component palette, then dropping them into either the UI designer or the component tree (lower left pane of the AppBrowser in design view). JBuilder will automatically generate the corresponding source code for you.
Even though the DataExpress
components are not visual, JBuilder displays them in the DataExpress folder in the component tree so you can select them and set their properties using the Inspector.
For more information on the JBuilder visual design tools, see "Designing a User Interface" in Building Applications with JBuilder.
You will need two DataExpress components to import data from a text file:
TextDataFile
to connect the TableDataSet
to a text file.
TableDataSet
to read a table (rows and columns) of data from a data source (in this case, the text file) and to work with the data in the JBuilder DataSet
format.
Follow the steps below to add these components to your application:
Frame1.java
.
Click the TextDataFile
component () on the DataExpress tab of the component palette.
Click anywhere in the component tree to add it to your application. textDataFile1
appears in the DataExpress folder of the component tree.
Click the TableDataSet
component () and add it to the application. It appears as
tableDataSet1
.
Choose File|Save All to save your work.
The first property you need to set is the fileName
property of the TextDataFile
component. This property tells JBuilder where to find the text file containing the data for textDataFile1
.
textDataFile1
in the component tree. The Inspector displays the properties for this component on the Properties tab.
fileName
property in the Inspector (the property value field). It changes color to show that it is active for editing.
/jbuilder/samples/DataExpress/TextDataFile/employee.txt
. Click Open.
textDataFile1.setFileName("/usr/local/jbuilder/samples/com/borland/ samples/DataExpress/TextDataFile/employee.txt");
employee.txt
at this time. This project also contains a SCHEMA file needed to import this text file. Later examples show you how to work with your own data files. See "Importing data from a text file."
Now you need to connect tableDataSet1
to the textDataFile1
component.
tableDataSet1
in the component tree.
dataFile
property value, then click the down arrow and select the entry for textDataFile1
.
tableDataSet1.setDataFile(textDataFile1);
The employee.txt
file is designed to work with the default settings stored in the TextDataFile
component for properties such as delimiter
, separator
, and locale
. If it was designed differently, the appropriate properties could be set at this point.
![]() |
Creating a user interface![]() |