CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: GUI, component locked to grid

  1. #1
    Join Date
    Oct 2004
    Ho Chi Minh, Vietnam

    GUI, component locked to grid

    I'm new to Swing GUI. I'm using Eclipse Ganymede to create simple GUI, just some buttons and text field on a JFrame. However, during the WYSIWYG, I cannot place the button freely, it must be either locked to some orientation (East, Center, North, South...) and make the button big and ugly. Anyway to turn that thing off.

  2. #2
    Join Date
    Apr 2007

    Re: GUI, component locked to grid

    If you aim to free yourself from any "gui designer" -tools, which is recommendable, there really is no other way around it, but pick up the spoon, and learning to Swing.

    All of this is rather throughly explained in Suns Swing tutorials, those should be the first place to look. Basically You have the flexibility of building your gui-puzzle of as many panels you like, each having the kind of LayoutManager you choose. The outlook, such as how the button looks and behaves in the layout, is in an optimal case quite completely down to the LayoutManagers you use.

    Then also, you have the option of using absolute placement. This however, is rarely suited and should not be any kind of stamp case to "get what you want". Combined use of LayoutManagers gets you to places in 99% if your likely cases, rest assured.

    Heres some kind of entry level package:


    Also remember to check up non layout related gui management, such as Borders.

    These are enough for most of the common place issues. More flexibility, and hence more coding, is involved in other managers, such as the following


    Then can provide a move concise way to describe a specific layout need. In the most used cases the coding can be stored in library classes for each layout, these would then provide you convinience methods resulting in the desired layout.

  3. #3
    Join Date
    Oct 2004
    Ho Chi Minh, Vietnam

    Re: GUI, component locked to grid

    Hey, tks for the reply, I'll give myself a treat on ur suggestions. For the time being, I'm quite satisfied with the plug-in "visual swing" it does exactly what I want, put the component anywhere on the form (put here for anyone who might faced the same problem). I remember such thing has been done by NetBeans, hasn't it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)