Results 1 to 2 of 2
Thread: Converting to full screen
- 09-11-2012, 12:16 AM #1
Member
- Join Date
- Sep 2012
- Posts
- 28
- Rep Power
- 0
Converting to full screen
I am trying to load an image into a full screen viewer. I am aware of the various classes but i cannot put the pieces together.
Here is the code
for the application
import java.awt.Graphics;
import java.awt.Panel;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
public class Main extends Panel
{ public static void main(String args[]) throws
Exception {
JFrame frame = new JFrame("Slime");
Panel panel = new Main();
frame.getContentPane().add(panel);
frame.setSize(500,500);
frame.setVisible(true);
}
public void paint(Graphics g) {
g.drawImage( img, 0, 0, null);
}
BufferedImage img;
public Main() {
try {img = ImageIO.read(new File
("C:/slime.jpg"));
} catch (IOException ie) {}
}//img method
}//End of Main class
How do i convert to full screen?
Thanks
- 09-11-2012, 04:33 AM #2
Re: Converting to full screen
You're expected to go through links posted in responses to your questions.
Java image load
Edit your post and add code tags.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
How to screen capture a running full screen DirectX program in Java?
By MEdiQueen in forum Advanced JavaReplies: 9Last Post: 09-06-2012, 09:37 AM -
Full screen problems
By doctorned in forum New To JavaReplies: 4Last Post: 12-10-2009, 09:40 AM -
Full screen test
By Java Tip in forum java.awtReplies: 0Last Post: 06-23-2008, 11:24 PM -
how to set full screen dimensions
By valery in forum New To JavaReplies: 1Last Post: 08-03-2007, 06:08 PM -
Full screen
By Jack in forum Advanced JavaReplies: 2Last Post: 07-02-2007, 05:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks