Jump to content
  • Advertisement
Sign in to follow this  
Falesh

[java] Porting a custom dialog from C# to Java

This topic is 4036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I have been porting a game from C# to Java, I've done most of it but I'm a bit stuck on how to convert a custom dialog. The dialog in question has a transparent background and looks like this:
BlockPopup.cs BlockPopup.Designer.cs
I would appreciate it if someone could point me in the right direction for how to do this in Java. Many thanks, John

Share this post


Link to post
Share on other sites
Advertisement
Same as C#, using buttons

For the "dialog", you'll need to use some other component, JComponent will do just fine, use setOpaque() to make it transparent.

So, make a new JComponent that will be your dialog equivalent, set it as opaque, override paintComponent to do nothing. Add buttons to this component as needed, setting the images as their icons.

Share this post


Link to post
Share on other sites
Thanks for the reply,

I was meaning a popup dialog box, that way I can ask for user input in the middle of the method. I will look into using a JComponent though as you suggest, it might be easier then making a custom popup.

Cheers,
John

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!