943,575 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 5411
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 13th, 2005
0

Bring component forward.

Expand Post »
Hi! I have a bunch of Jbuttons which are scattered over each other. Is there a method which will bring the button the user selected to the front of the pack?

Thanks!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Mar 13th, 2005
0

Re: Bring component forward.

Hi everyone,

You can do this

Java Syntax (Toggle Plain Text)
  1.  
  2. JComponent.grabFocus();

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 13th, 2005
0

Re: Bring component forward.

Ta for the info! But it didn't work
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Mar 13th, 2005
0

Re: Bring component forward.

Hi everyone,

Well in that case i not sure how to do it

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 13th, 2005
0

Re: Bring component forward.

Why are the buttons on top of each other in the first place?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Mar 13th, 2005
0

Re: Bring component forward.

Hi everyone,

Good question server crash. That seems like bad layout programming to me or am i missing something.

p.s - check out my new signature

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 14th, 2005
0

Re: Bring component forward.

You guys are missing something I am creating a scatter field, each star being a button (1700 of them to be exact). Therefor the buttons are placed depending on their x,y attributes and can overlay each other. The user can move sliders to make buttons dissapear to make the scatterfield more accurate towards their query. But when they haven't got a query it would be nice for the buttons to move forward infront of the pack if the user clicks on them. Thanks for the help though
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Mar 14th, 2005
0

Re: Bring component forward.

I'm not sure how to do that, altought it could be possible. My only worry, would be that it depends on the order in which you added them to a container, and the buttons added last got put on top. I'll be searching the internet for a solution and get back to you if I find one.

Quote originally posted by freesoft_2000 ...
p.s - check out my new signature
Looks good, but I think you should bold the part at the bottom if you want more traffic..
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Mar 14th, 2005
0

Re: Bring component forward.

Thats great thanks. Yeah i was thinking that i might be able to remove and add the button when the user clicks it - might flicker. I will try it anyway.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004
Mar 14th, 2005
0

Re: Bring component forward.

Sorry for the double post, Im not sure how to edit the above message?

I tried the above and it kinda worked. However other buttons moved around it and it wasn't a very reliable method.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
MrScruff is offline Offline
89 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Help implementing a binary search tree in Java
Next Thread in Java Forum Timeline: Alert Message





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC