Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Game Development
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
Game Development
Displaying Images
Scott Makos
,
Greenhorn
Nov 27, 2005 17:04:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
I need to create an application (Non-Web based) that displays images. Is it possible to display images without a border in swing?
Any reply would be extremely grateful.
Scott
Jeff Albertson
,
Ranch Hand
Nov 28, 2005 11:32:00
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Are you referring to "undecorated" windows?
import java.awt.event.*; import java.net.*; import javax.swing.*; public class ImageDisplay { public static void main(String[] args) throws MalformedURLException { URL url = new URL("http://blogs.sun.com/roller/resources/jag/SouthParkJAG-small.png"); final JFrame f = new JFrame("ImageDisplay"); f.addMouseListener(new MouseAdapter(){ public void mousePressed(MouseEvent evt) { System.exit(0); } }); f.setUndecorated(true); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(new JLabel(new ImageIcon(url))); f.pack(); SwingUtilities.invokeLater(new Runnable(){ public void run() { f.setLocationRelativeTo(null); f.setVisible(true); } }); } }
You may also be interested in full-screen mode:
http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html
Post by:
autobot
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
This thread has been viewed 1078 times.
Similar Threads
Where do you live?
Directory Traversal
Graphs in JSF
page content type
utf8 to unicode..from browser to oracle db
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:26:40
.