JTextField


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: JTextField

  1. #1
    ed Guest

    JTextField


    Hi, I'm having major trouble positioning two fields a JTextField & JPasswordField
    for a login dialog box that I'm trying to create. Is it just me or would
    this Swing story seem quite annoyingly intricate, Boxes and frames and panels
    and....YUCK!!!

    Any help would be appreciated

    tia,

    ed

  2. #2
    Tom Duffy Guest

    Re: JTextField


    Hello Ed:

    Use setBounds(int,int,int,int) to position either component anywhere you
    want. I always try to add the component to the container first, then call
    setBounds() and pass in x,y,width,height (can't remember specific order off
    the top of my head - sorry).

    HTH,

    Tom

    "ed" <edejongh@businesseurope.com> wrote:
    >
    >Hi, I'm having major trouble positioning two fields a JTextField & JPasswordField
    >for a login dialog box that I'm trying to create. Is it just me or would
    >this Swing story seem quite annoyingly intricate, Boxes and frames and panels
    >and....YUCK!!!
    >
    >Any help would be appreciated
    >
    >tia,
    >
    >ed



  3. #3
    David Guest

    Re: JTextField


    if you find Swing "annoyingly intricate", then i believe you're doing something
    really wrong. Are you using any graphical IDE? if not, better get one. And
    have you even heard of a Layout Manager? If you want to line those fields
    up, throw them in a JPanel with GridLayout!


    >"ed" <edejongh@businesseurope.com> wrote:
    >>
    >>Hi, I'm having major trouble positioning two fields a JTextField & JPasswordField
    >>for a login dialog box that I'm trying to create. Is it just me or would
    >>this Swing story seem quite annoyingly intricate, Boxes and frames and

    panels
    >>and....YUCK!!!
    >>
    >>Any help would be appreciated
    >>
    >>tia,
    >>
    >>ed

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center