Results 1 to 2 of 2

Thread: jframe

  1. #1
    amith is offline Member
    Join Date
    May 2008
    Rep Power

    Default jframe

    contains all the5 .png files of different color names red blue ............
    and i just written a program
    import javax.swing.*;
    import java.awt.*;
    class q
    public void static void main(String args[])
    JFrame w=new JFrame();
    Container c=getContentpane();
    //iam loding image form res folder
    Image r=getImage(getCodeBase(),"red.png");
    it is giving me error and it is not showing my images in the jframe
    plz tell me how to add images in a jframe but dont make complicated it with buffered io or plz tell me in a simple manner tell me in a simple manner in a jframe or jpanel or swings and also i just want 4 out 5 images to placed in random order whenever i execute the application

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    Lots of errors I can see in your code.

    main method definition is wrong.

    Java Code:
    public static void main(String[] args) {
      // Content of the method

Similar Threads

  1. how to use JFrame in JSP ??
    By priyanka sharma in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 04-06-2011, 04:51 AM
  2. JFrame maximizing
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-12-2008, 12:19 PM
  3. JFrame problem
    By vassil_zorev in forum AWT / Swing
    Replies: 1
    Last Post: 01-25-2008, 03:53 AM
  4. JFrame (Hello World)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-14-2007, 07:27 PM
  5. Help with JFrame
    By Albert in forum AWT / Swing
    Replies: 2
    Last Post: 07-04-2007, 04:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts