![]() |
|
[Java] How do I add a picture gui behind my java gui. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] How do I add a picture gui behind my java gui. (/showthread.php?tid=3308236) |
How do I add a picture gui behind my java gui. - Arete - Mar 6, 2013 For exmaple I wanted to take just the regular like this: [img]http://www.mathworks.com/help/matlab/creating_guis/overview_gui_options.png[/img] To something like with my own photoshoped picture in the background. It's hard to explain. I see people in rate my gfx doing GUI's all the time and I want to know how to input it in my program. ATM I'm using netbeans gui creator. * - vitafortis - Mar 6, 2013 You can set the Background Image or color to anything you want. Google Java set JPanel, or frame, background image. * - Coelho - Mar 6, 2013 You can use a JLabel and set an icon, or you can hook onto the paint function and draw your image using java.awt.Graphics2D. * - Lottery. - Mar 6, 2013 (Mar 6, 2013 05:43 PM)Coelho Wrote: You can use a JLabel and set an icon, or you can hook onto the paint function and draw your image using java.awt.Graphics2D. This. Using the JLabel to set an image as it's "icon" is probably the easiest way of displaying images. I am truly not familiar with any other method. * - MistaMarc - Mar 6, 2013 For Java you must set a JPanel in order to display background-images (without to override anything). Its maybe not enough to use any plain jframe/jdialog. Within the JPanel, you set the image and then draw your gui elements over it. |