Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
osirisua
osirisua's Profile
1
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Can't use loadImage in JFrame NetBeans
[7 Replies]
20-Apr-2013 03:25 AM
Forum:
Integration and Hardware
I have add project to NetBeans.
I used in processing and it was good.
PImage img;
public void setup()
{
size(640,360);
img = loadImage("Grumpy.jpg");
}
public void draw()
{
image(img,0,0);
}
Now I created Interface and need to load "Grumpy.jpg" to JFrame
Wrote in this way in Interface.class
public class Interface extends javax.swing.JFrame {
PImage img;
/**
* Creates new form Interface
*/
public Interface() {
initComponents();
MyGrumpy setup = new MyGrumpy();
setup.loadImage("Grumpy.jpg");
MyGrumpy draw = new MyGrumpy();
draw.image(img,20,20,640,360);
}
But got
Error:
Exception in thread "main" java.lang.NullPointerException
at processing.core.PApplet.image(PApplet.java:12258)
at grumpy.Interface.<init>(Interface.java:24)
at grumpy.Grumpy.main(Grumpy.java:14)
Please, help
«Prev
Next »
Moderate user : osirisua
Forum