Click here to Skip to main content
15,896,153 members
Home / Discussions / Java
   

Java

 
GeneralRe: Getting an applet's components returns null [modified] Pin
fly9049-May-09 6:06
fly9049-May-09 6:06 
GeneralRe: Getting an applet's components returns null Pin
rareseu9-May-09 6:13
rareseu9-May-09 6:13 
GeneralRe: Getting an applet's components returns null Pin
fly9049-May-09 6:23
fly9049-May-09 6:23 
GeneralRe: Getting an applet's components returns null Pin
rareseu9-May-09 7:01
rareseu9-May-09 7:01 
Questionword online editor in jsp [modified] Pin
qiuxumin18-May-09 21:48
qiuxumin18-May-09 21:48 
AnswerRe: word online editor in jsp Pin
fly9048-May-09 23:12
fly9048-May-09 23:12 
GeneralRe: word online editor in jsp Pin
qiuxumin110-May-09 2:23
qiuxumin110-May-09 2:23 
QuestionDrawing in a canvas Pin
rareseu8-May-09 9:52
rareseu8-May-09 9:52 
Hy guys ! i've been using netbeans to make a GUI, and i'm having rpoblems figuring out how to draw stuff using the canvas object, i've created a canvas object but it needs a graphics object in order to draw stuff, and that's where my problems start, for the life of me i can not understand how to use one of these

this is what i've tried so far :

Graphics g=null;
g.setColor(new Color(255,0,0));
canvas1.paint(g);


when i run this java flares up with null pointer exceptions altho the canvas itself has been instantiated

i've looked on the sun homepage for guidance but there is no hint on how to use an instance of a canvas object, they way they show is by creating a class that inherits Canvas and overwriting it's paint method, but that's no use to me
AnswerRe: Drawing in a canvas Pin
Jimmanuel8-May-09 10:11
Jimmanuel8-May-09 10:11 
GeneralRe: Drawing in a canvas Pin
rareseu8-May-09 10:18
rareseu8-May-09 10:18 
GeneralRe: Drawing in a canvas Pin
Jimmanuel8-May-09 10:37
Jimmanuel8-May-09 10:37 
GeneralRe: Drawing in a canvas Pin
rareseu8-May-09 10:51
rareseu8-May-09 10:51 
GeneralMaybe this will help Pin
Jimmanuel8-May-09 12:54
Jimmanuel8-May-09 12:54 
GeneralRe: Maybe this will help Pin
rareseu8-May-09 22:17
rareseu8-May-09 22:17 
AnswerRe: Drawing in a canvas Pin
fly9048-May-09 10:38
fly9048-May-09 10:38 
GeneralRe: Drawing in a canvas Pin
rareseu8-May-09 22:38
rareseu8-May-09 22:38 
GeneralRe: Drawing in a canvas Pin
fly9048-May-09 23:06
fly9048-May-09 23:06 
GeneralRe: Drawing in a canvas Pin
rareseu8-May-09 23:12
rareseu8-May-09 23:12 
GeneralRe: Drawing in a canvas Pin
fly9048-May-09 23:27
fly9048-May-09 23:27 
GeneralRe: Drawing in a canvas Pin
rareseu8-May-09 23:28
rareseu8-May-09 23:28 
Questionneed help Pin
ahmedbhatti8-May-09 9:30
ahmedbhatti8-May-09 9:30 
AnswerRe: need help Pin
fly9048-May-09 10:08
fly9048-May-09 10:08 
Questioncomparing images in java Pin
nicks112858-May-09 2:44
nicks112858-May-09 2:44 
AnswerRe: comparing images in java Pin
Tyler458-May-09 5:04
Tyler458-May-09 5:04 
Questionlabel in java Pin
9002code7-May-09 20:53
9002code7-May-09 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.