This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

GUI question

 
danesh far
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I�ve written the following class ShowImage to put image on the screen but what I got was a blank window.Why could not I see the image on the screen?



import javax.swing.*;
import java.awt.*;


public class ShowImage extends JFrame {

public static void main(String[ ] args) {

ShowImage si=new ShowImage();
Graphics g=si.getGraphics();
Image im;
Toolkit T=si.getToolkit();
im=T.getImage("Jumbo.jpg");
g.drawImage(im, 50,50,si);
}
public ShowIm(){
this.setSize(770, 420);
this.setVisible(true);
}
}
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
There seems to already be several threads relating to this question -- please do not cross-post / post multiple times. I am closing this thread; please direct all responses here
[ November 26, 2004: Message edited by: Joel McNary ]
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic