Results 1 to 4 of 4

Thread: Layout help

  1. #1
    mafyou is offline Member
    Join Date
    Feb 2012
    Posts
    10
    Rep Power
    0

    Default Layout help

    Hey all, I was just wondering... What layout do I use if I want to specify where to put a component (such as a JButton) on a JPanel.

    i.e. I want to put JButton XX at point (x,y).

    I've tried XX.setLocation(x,y) but I think the layout interferes with it...

  2. #2
    mafyou is offline Member
    Join Date
    Feb 2012
    Posts
    10
    Rep Power
    0

    Default Re: Layout help

    Duh... so sorry guys. Just realised what it was I was doing wrong...

    Needed to set the layout to null AND set the size as well... *ashamed face*

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

  4. #4
    mafyou is offline Member
    Join Date
    Feb 2012
    Posts
    10
    Rep Power
    0

    Default Re: Layout help

    Yeah I'm pretty sure I'll never use null layout ever again... I just needed an AWT solution for the SWT FormLayout which was letting me move a label to the position I clicked. More as a learning exercise into Plug-in stuff. If you have any other workarounds for this I'd be glad to hear them.

Similar Threads

  1. Grid Layout change layout alignment of control s
    By rellicott in forum SWT / JFace
    Replies: 1
    Last Post: 02-13-2012, 05:11 PM
  2. Help trying to set GUI layout
    By JLSHARP92 in forum AWT / Swing
    Replies: 5
    Last Post: 01-24-2012, 06:59 PM
  3. Please help me in this layout :(
    By orionorion in forum Java Applets
    Replies: 1
    Last Post: 02-09-2011, 02:47 PM
  4. Edit layout Layout please help me
    By manhtungtnk28@gmail.com in forum New To Java
    Replies: 4
    Last Post: 11-23-2009, 08:41 AM

Posting Permissions

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