A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Game Development
Author
Displaying Images
Scott Makos
Greenhorn
Joined: Nov 27, 2005
Posts: 2
I like...
posted
Nov 27, 2005 17:04:00
0
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
Joined: Sep 16, 2005
Posts: 1780
posted
Nov 28, 2005 11:32:00
0
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
There is no emoticon for what I am feeling!
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Displaying Images
Similar Threads
utf8 to unicode..from browser to oracle db
Directory Traversal
Where do you live?
page content type
Graphs in JSF
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter