I am currently going through a JPPF (Java Parallel Processing Tutorial) and for this, I downloaded some folders with libraries and classes that are some kind of templates for a project using this...
Type: Posts; User: piulitza
I am currently going through a JPPF (Java Parallel Processing Tutorial) and for this, I downloaded some folders with libraries and classes that are some kind of templates for a project using this...
I have a problem with a program that I try to make. Inside a JFrame class, I start one Thread. That thread checks something and return a boolean as true or false. Inside the JFrame class I want to...
I tried to do like that but I only got nullpointer exceptions. I ended with creating JButton class and drawing each button there inside the paintComponent method. Like that I no longer needed any...
I have created one program with GUI using Eclipse. I need to export it as a runnable .jar file. I do exactly as I seen on some tutorials.
My problem is the following:
Many of my buttons have...
By not working I mean for example if i set the Loading FilenameFilter with ".txt", it will not show only .txt files as I wanted, it still shows all files in the folder!!!
While coding in Java, I did many programs with GUI at which I needed to save something to a file. I usually use FileDialog to save something. Sometimes I wanted to filter the names of files that I...
I have one question. I noticed that when I use a FileDialog, every command that follows making the FileDialog to be visible only continues only after I close the FileDialog.
But I am looking to make...
I have a problem with using MouseListener.
I am working to make a simulator for some electronic devices. I have some buttons for each kind of component I want to draw on a Canvas area. And if I...
You can paint that component again with the background's colour, usually white.
I want to make a program that uses some of the Java Media Framework classes. I have the following problem:
In this object declaration:
private MediaLocator mediaLocator = null;
I use...
There is one more way to read from a file: using Scanner class. You can use this constructor:
Scanner in = new Scanner (new File(url));
And after you can read Strings from the file, or...
Try to use
or
These should work better to close a JFrame
I made a smaller program to make it easier to put here:
Here is a class which extends Canvas. Inside the method paint i draw a String. And, i add mouselisteners to make it possible to draw on the...
I have worked for a while to make a paint-like program. The area that i use to draw is a Canvas. Now, i want to save whatever i draw on it ...to a file on my harddisk. I have tried like this:
...
I am working to make a kind of paint. I got stuck to something that i do not understand. Look here the fragment of code which is making problem:
System.out.println("forma: " + fp.forma);
...
Hah ...finally i managed make it work ....i should have not changed the filesize variable to the size of the file....because it makes that bytearray length and current to have same value...so that is...
Well , seems there is something wrong with Threads that send/receive the file.
I made some classes separated from the messenger project, and i discovered that they actually have a problem (not the...
Yeah, that works properly! The size of the file is sent to the main serversocket of my messenger, inside the String containing the word FILE. I have "cut " the String and got the size from that...
Yeah, you are right. I think it cannot send a .bmp file properly, or maybe it cannot crate a bytearray that large, as the bmp file dimension. I tried to send a .txt file which is smaler and it...
So far, i manged to make it work fine with sending text message. Now i want to make my messenger to send a file from one user to the other. But i do not manage to make 2 simple sockets to send one...
I have to make a program at which i have to read something from a file using FileReader.
I write here the fragment of the code which reads an integer from the file :
try
{
FileReader...
So far, at Java i learned how to work with streams, with Threads and how to make GUI using AWT or Swing components; i also learned how to make an applet. I want to make step forward. I heared that it...
basically on each computer should run 2 Threads:
one of them sends the message having the role of server and the other one receives the message having the role of client!
I got to do a kind of Messenger in Java. Well .. it will not have to do something with a server or making accounts. Will simply be a program which will be used to communicate between 2 computers into...
Yeah, it worked !! It is good to know i should not create the applet classes inside the packages.