You need to start at the beginning to learn how to build a GUI app and use the different java classes. Here is a link to the tutorial. Find an interesting topic and read about it.
The Really Big...
Type: Posts; User: Norm
You need to start at the beginning to learn how to build a GUI app and use the different java classes. Here is a link to the tutorial. Find an interesting topic and read about it.
The Really Big...
Where did you get that code? What does it have to do with creating and saving an image to a disk file?
You are copying too much code that you do not understand into your program.
You are trying...
Please copy and paste here the full text of the error message. Images are no good because you can not copy text from them to do a find for what is referred to in the error message.
To copy the...
Please post the full text of the error message.
What is the method you posted supposed to do? The image already exists in the code in post#13
When you get errors, you need to copy and paste here the full text of the error message.
The first code you posted has code in it to write an image to a file. Copy the code from that program.
Is that the variable named: image? That is where the image has been drawn.
Write the image in the image variable to a file.
Can make a small simple program that compiles, executes and shows the problem? The posted code has endcode and decode classes and other stuff that is not part of the problem.
There are lots of code examples here on the forum. Do a search for paintComponent for example.
Also look at the tutorial:
http://docs.oracle.com/javase/tutorial/uiswing/painting/index.html
You need to save the points used to draw the lines in some container like an arraylist so you can you use them when you want to save what was drawn on the jpanel.
Your method of drawing the image...
copy the source to a new folder away from the other files and try compiling it.
The code does not compile because of missing class definitions.
How does the code get what was written on the canvas so it can be written to a file?
Where are you trying to write the image to a file?