OK.  Thanks
Kevin

--- Aylesworth Marc A Ctr AFRL/IFSE
<[EMAIL PROTECTED]> wrote:

> The Frame is an AWT Frame. This is only used to
> indicate that the Frame is
> the parent of the dialog box so that the dialog box
> is positioned relative
> to the parent and could not be hidden behind the
> parent and not be able to
> be selected because dialog boxes are modal.
> 
> Thanks
> 
> Marc 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
>
[mailto:[EMAIL PROTECTED]
> On Behalf Of Kevin
> Toppenberg
> Sent: Tuesday, July 12, 2005 8:49 AM
> To: hardhats-members@lists.sourceforge.net
> Subject: Re: [Hardhats-members] Data dictionary
> question...
> 
> I've done very little with java, so let me feel my
> way
> here.
> 
> I assume that function public LoginDialog is the
> constructor for class LoginDialog.  I see Frame
> passed
> as a parameter to the constructor, but I don't see
> that you use it.  What is it doing?
> 
> Kevin
> 
> 
> --- Gregory Woodhouse
> <[EMAIL PROTECTED]> wrote:
> 
> > Well, here's some code I wrote to implement a
> login
> > dialog (not that  
> > I'm all that proud of it -- I think it's ugly).
> You
> > can see that this  
> > is exactly how the reference passed to the
> > constructor is used.
> > 
> > 
> > import java.awt.*;
> > import java.awt.event.*;
> > import java.util.*;
> > import javax.swing.*;
> > import javax.swing.event.*;
> > import javax.swing.border.*;
> > 
> > 
> > public class LoginDialog extends JDialog {
> > 
> >          private JButton l_loginButton;
> >          private JButton l_cancelButton;
> >          private Container l_content;
> >          private Triton l_application;
> > 
> >          public LoginDialog(Frame parent) {
> >                  super(parent, "Login", true);
> >                  l_application = (Triton) parent;
> >                 
> > setDefaultCloseOperation(DISPOSE_ON_CLOSE);
> >                  l_content = getContentPane();
> > 
> >                  l_loginButton = new JButton("Log
> > in");
> >                 
> l_loginButton.addActionListener(new
> > ActionListener() {
> >                          public void
> > actionPerformed(ActionEvent ae) {
> >                                  signIn();
> >                                 
> setVisible(false);
> >                                  dispose();
> >                          }
> >                  });
> > 
> >                  l_cancelButton = new
> > JButton("Cancel");
> >                 
> > l_cancelButton.addActionListener(new
> > ActionListener() {
> >                          public void
> > actionPerformed(ActionEvent ae) {
> >                                 
> > l_application.setConnected(false);
> >                                 
> setVisible(false);
> >                                  dispose();
> >                          }
> >                  });
> > 
> >                  JPanel p = new JPanel();
> >                  //p.setLayout(new
> GridLayout(2,1));
> >                  EmptyBorder empty = new
> > EmptyBorder(0, 0, 0, 10);
> >                  p.setLayout(new GridBagLayout());
> >                  p.setBorder(new EmptyBorder(new
> > Insets(5, 5, 5, 5)));
> >                 
> > getContentPane().add(BorderLayout.CENTER, p);
> >                  GridBagConstraints c = new
> > GridBagConstraints();
> >                  c.insets = new Insets (2, 2, 2,
> 2);
> >                  c.anchor =
> GridBagConstraints.WEST;
> >                  JLabel name_label = new
> > JLabel("Login Name");
> >                  name_label.setBorder(empty);
> >                  c.gridwidth = 1;
> >                  c.weightx = 0.0;
> >                  p.add(name_label, c);
> >                  JTextField name = new
> JTextField();
> >                  c.gridx = 1; //position
> >                  c.weightx = 1.0;
> >                  c.fill =
> > GridBagConstraints.HORIZONTAL;
> >                  p.add(name, c);
> >                  JLabel password_label = new
> > JLabel("Password");
> >                  c.gridwidth = 1;
> >                  c.gridx = 0;
> >                  c.gridy = 1;
> >                  c.weightx = 0.0;
> >                  p.add(password_label, c);
> >                  JPasswordField password = new
> > JPasswordField();
> >                  c.weightx = 1.0;
> >                  c.gridx = 1;
> >                  p.add(password, c);
> >                  setSize(300,200);
> >                  c.weightx = 0.0;
> >                  c.gridx = 0;
> >                  c.gridy = 2;
> >                  p.add(l_loginButton, c);
> >                  c.gridx = 1;
> >                  c.gridy = 2;
> >                  c.weightx = 0.0;
> >                  c.fill= GridBagConstraints.NONE;
> >                  p.add(l_cancelButton, c);
> >          }
> > 
> > 
> >          protected void signIn() {
> >                  l_application.setConnected(true);
> >          }
> > 
> >          protected void signOut() {
> >                 
> l_application.setConnected(false);
> >          }
> > }
> > 
> > ===
> > Gregory Woodhouse
> > [EMAIL PROTECTED]
> > 
> > "The whole of science is nothing more than a
> > refinement
> >   of everyday thinking."  -- Albert Einstein
> > 
> > 
> > On Jul 11, 2005, at 5:15 PM, Kevin Toppenberg
> wrote:
> > 
> > > I wonder if the reference to the JFrame is for a
> > > messaging system.  In Borland/Windows, a GUI
> > object
> > > has both an 'owner' (one responsible for
> utimately
> > > destroying it) as well as a 'parent' (one from
> > whom
> > > one receives windows messages).  I can't see why
> > your
> > > objects would need to reference the JFrame (is
> > this a
> > > graphic frame?) unless it was for messaging
> (i.e.
> > > "time to repaint your area!")
> > >
> > > Kevin
> > >
> > >
> > 
> > 
> > 
> >
>
-------------------------------------------------------
> > This SF.Net email is sponsored by the 'Do More
> With
> 
=== message truncated ===



                
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to