This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Toggles Button and Additional Text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Toggles Button and Additional Text" Watch "Toggles Button and Additional Text" New topic
Author

Toggles Button and Additional Text

Eliza Parker
Greenhorn

Joined: Apr 25, 2012
Posts: 2
Hello there, I'm new to the website. I hope i could get some help with my java.
Here's what it looks like



I required to activate those toggles Metric button, by clicking it. Then the unit will convert into ft and lb instead m and kg. I'm not sure how to do it.
Also, i need to move the Pop up message dialog box outside into the same window, rather than separate window.
Any tips on how to do it ?
Thanks



Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Hi Eliza,
Welcome to the Ranch!

I am unable to see the image. As for toggling, there is a separate JToggleButton available - I think that fits your scenario. You can read about them in the tutorial here.

As for the popup, you have passed 'null' to the first parameter of the showMessageDialog. This paramater indicates the 'owner' of the popup - in your case, you have to pass the instance of the your main frame for the popup to appear inside.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Eliza Parker
Greenhorn

Joined: Apr 25, 2012
Posts: 2
Ranganathan Kaliyur Mannar wrote:Hi Eliza,
Welcome to the Ranch!

I am unable to see the image. As for toggling, there is a separate JToggleButton available - I think that fits your scenario. You can read about them in the tutorial here.

As for the popup, you have passed 'null' to the first parameter of the showMessageDialog. This paramater indicates the 'owner' of the popup - in your case, you have to pass the instance of the your main frame for the popup to appear inside.


Thanks, here's i already update the picture. I'll try to give them a go on JToggleButton later.
Um, actually i dont need to move the pop up. I just required the following text to be appear inside the box. Not the pop up. I said it wrong way on previous post.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Toggles Button and Additional Text
 
Similar Threads
values changed, math didnt.
values changed, math didnt.
Looping correctly
bmi calculation help please!
Calculate button action code