Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toggles Button and Additional Text

 
Eliza Parker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eliza Parker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic