home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 2.9 KB | 120 lines |
- /*
- A basic extension of the java.awt.Frame class
- */
- package symantec.itools.db.beans.jdbc;
- import java.awt.*;
-
-
- import symantec.itools.awt.WrappingLabel;
-
- public class FrameTestData extends Frame
- {
- public FrameTestData()
- {
- // This code is automatically generated by Visual Cafe when you add
- // components to the visual environment. It instantiates and initializes
- // the components. To modify the code, only use code syntax that matches
- // what Visual Cafe can generate, or Visual Cafe may be unable to back
- // parse your Java file into its visual environment.
- //{{INIT_CONTROLS
- setLayout(null);
- setVisible(false);
- setSize(insets().left + insets().right + 430,insets().top + insets().bottom + 270);
- list1 = new java.awt.List(0,false);
- add(list1);
- list1.setBounds(insets().left + 12,insets().top + 96,411,169);
- wrappingLabel1 = new symantec.itools.awt.WrappingLabel();
- wrappingLabel1.setBounds(insets().left + 12,insets().top + 12,409,72);
- add(wrappingLabel1);
- setTitle("Untitled");
- //}}
-
- //{{INIT_MENUS
- //}}
-
- //{{REGISTER_LISTENERS
- SymWindow aSymWindow = new SymWindow();
- this.addWindowListener(aSymWindow);
- //}}
-
- }
-
- public FrameTestData(String title)
- {
- this();
- setTitle(title);
- }
-
- public synchronized void show()
- {
- move(50, 50);
- super.show();
- }
-
- public void addNotify()
- {
- // Record the size of the window prior to calling parents addNotify.
- Dimension d = getSize();
-
- super.addNotify();
-
- if (fComponentsAdjusted)
- return;
-
- // Adjust components according to the insets
- setSize(insets().left + insets().right + d.width, insets().top + insets().bottom + d.height);
- Component components[] = getComponents();
- for (int i = 0; i < components.length; i++)
- {
- Point p = components[i].getLocation();
- p.translate(insets().left, insets().top);
- components[i].setLocation(p);
- }
- fComponentsAdjusted = true;
- }
-
- // Used for addNotify check.
- boolean fComponentsAdjusted = false;
-
-
-
- //{{DECLARE_MENUS
- //}}
-
- class SymWindow extends java.awt.event.WindowAdapter
- {
- public void windowClosing(java.awt.event.WindowEvent event)
- {
- Object object = event.getSource();
- if (object == FrameTestData.this)
- Frame1_WindowClosing(event);
- }
- }
-
- void Frame1_WindowClosing(java.awt.event.WindowEvent event)
- {
- hide(); // hide the Frame
- }
- public void fillSqlStatement(String sqlStat){
- try{
- wrappingLabel1.setText(sqlStat);
- wrappingLabel1.repaint();
- }
- catch(Exception e){}
- }
- public void fillData(String[] data){
- int length=data.length;
- list1.clear();
- for(int i=0;i<length;i++)
- list1.addItem(data[i]);
- list1.repaint();
- }
-
- //{{DECLARE_CONTROLS
- java.awt.List list1;
- symantec.itools.awt.WrappingLabel wrappingLabel1;
- //}}
- //{{DECLARE_MENUS
- //}}
- }
-