Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2008, 11:49 AM
Member
 
Join Date: May 2008
Posts: 22
amith is on a distinguished road
jframe
F:\a\a\res\
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");
c.add(r);
w.add(c);
}
}
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 image.io 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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-15-2008, 12:03 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Lots of errors I can see in your code.

main method definition is wrong.

Code:
public static void main(String[] args) { // Content of the method }
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use JFrame in JSP ?? priyanka sharma JavaServer Pages (JSP) and JSTL 7 11-28-2008 09:03 AM
JFrame maximizing Java Tip Java Tips 0 03-12-2008 01:19 PM
JFrame problem vassil_zorev AWT / Swing 1 01-25-2008 04:53 AM
JFrame (Hello World) Java Tip Java Tips 0 12-14-2007 08:27 PM
Help with JFrame Albert AWT / Swing 2 07-04-2007 06:44 AM


All times are GMT +3. The time now is 03:03 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org