Results 1 to 5 of 5
  1. #1
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default Again Interesting JButton Query

    See I am making a Dock and my dock items are basically JButtons

    So to delete the Dock Item from my Dock i want to introduce a close button on each JButton

    My query is

    I want to add a Button in a JButton and at a particular location on that JButton

    Eg:

    JButton dockitem=new JButton("dockitem");

    JButton close=new JButton("close");

    Now i want to embed close in dockittem at right top corner so can anyone help me out :)

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,004
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ravjot28 View Post
    See I am making a Dock and my dock items are basically JButtons

    So to delete the Dock Item from my Dock i want to introduce a close button on each JButton

    My query is

    I want to add a Button in a JButton and at a particular location on that JButton

    Eg:

    JButton dockitem=new JButton("dockitem");

    JButton close=new JButton("close");

    Now i want to embed close in dockittem at right top corner so can anyone help me out :)
    Buttons on top of other Buttons aren't interesting, they are confusing to the user. Better put a small 'X' button next to the first one or even better offer a choice to the user which one to close. (in case of physical user deficiencies).

    kind regards,

    Jos
    Last edited by JosAH; 01-15-2010 at 05:20 PM.

  3. #3
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    5

    Default

    How about nesting both buttons into a JPanel. BorderLayout could work

  4. #4
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default

    well i tried to put the x button using panels but the GUI is not that cool is their any suggestion where can i put the close button for a particular button

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

    Default

    Quote Originally Posted by ravjot28 View Post
    well i tried to put the x button using panels but the GUI is not that cool is their any suggestion where can i put the close button for a particular button
    Without seeing your code and images, I'm not sure how we can begin to make suggestions here. Consider posting an SSCCE so we can see and run what you've currently have.

Similar Threads

  1. Interesting JButton Query
    By ravjot28 in forum AWT / Swing
    Replies: 3
    Last Post: 01-14-2010, 04:54 PM
  2. Interesting CS problem. Need help.
    By xtrmi in forum New To Java
    Replies: 1
    Last Post: 05-02-2009, 03:51 AM
  3. Interesting Experiment
    By uncommon in forum Advanced Java
    Replies: 13
    Last Post: 12-20-2008, 11:30 PM
  4. Interesting topic in JComboBox
    By success21061985 in forum NetBeans
    Replies: 0
    Last Post: 08-21-2008, 12:43 PM
  5. Tricky but very interesting problem
    By ravjot28 in forum New To Java
    Replies: 4
    Last Post: 06-26-2008, 01:43 PM

Posting Permissions

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