Happy Birthday, may u grow as a giant among forums and be the envy of all other forum... simple da best.
Type: Posts; User: dumb_terminal
Happy Birthday, may u grow as a giant among forums and be the envy of all other forum... simple da best.
Thank U, wud u blv i am also a noob ? Anyway if u plan a GUI, pay extra attention, u need to seperate the GUI classes in Event dispatching thread (google it), but first try out some multithreading in...
consider a to z, 0 to 25 and store the bit pattern in the corresponding array (the first index). Suppose a[2][] will contain pattern for c, u will search the array if match found add 97 to its index....
possible, if u seperate ur listen and run() in seperate thread. the runnable class will get clients in and output streams and serve accordingly, if the no of clients is small then a runnable for a...
U mean to say u wanna accept only one connection ?? then
client = null
while(true){
client = server.accept() ;
if (client != null){
// start thread and break this loop
}
}...
retun power ;
return channel ;
return volume ;
respectively.
/**
* This class represents a television, which can be turned on and off,
* change channels, and change volume
*
an easy solution wud be ArrayList
import java.util.Scanner ;
import java.util.ArrayList ;
class Whatever{
public static void main(String [] args){
Scanner s = new...
R u having trouble reading numbers ?? Try java.util.Scanner ;
import java.util.Scanner ;
class Whatever{
public static void main(String [] args){
Scanner in = new Scanner(System.in)...
Should be simple enough. U need multithreading if u desire to service multiple client. I am giving a layout not actual source.
Server:
class server{
main(){
ServerSocket ss = new...
if java.util.Random is available in applet environment then i don't see a problem. The thing is r.nextInt() where r is an instance of Random, produces negative value. So to produce a number between...
Hello all, I am trying to send file across network using ObjectInputStream() and ObjectOutputStream().
My File class is Serializable which is this:
package Unicorn.UnicornUtilities ;
import...
well sorry sir for not understanding SSCCE properly. well the problem is after clicking the first button several times ( redrawing several times ) the hello button click prints loads of "hello world"...
thanx...and sorry for late reply. couldn't get the time to finish the gui link yet but on to it. anyway here is the SSCCE yeah could do it with a single class but my real structure is something like...
Yes and No. I know when and what to paint but yes it depends on user interaction a very variable ummm thing.
Any way i am not a proffessional just a student trying to learn, what is SSCCE ? and how...
Hello all,
I have been facing a problem. I have several ( and i mean several ) class that contains swing elements, implements mouse listener and have a routine called draw. instead of creating new...
Worked like charm.... thanks. ^:)^
It hung when either one of the side was trying to get the Streams. I commented out the input stream of server and output stream of the client then worked just fine. Yup the observer is getting update...
it hangs so that means its most probably a deadlock, could it be a Thread - Adress space issue since the observable is ruunning on a different thread and the observer on main thread ? but then again...
Thank u very much for ur awsome hard work, really grateful. This one is sure to help, the way it is structured.
Hello all, I was wondering whether it is possible for a class implementing runnable, to notify another class through Observable ?? I mean i have tried it and end up with two non responding program....
Oh sorry, i misunderstood u, sorry for my bad english, actually i was in a hurry, so didn't recheck. instead puting the fact that the the painting occured only when mouse was over at last mangled it...
java2s. really weak in GUI programming, later i seriously debugged and found out that i was calling the drawing routine at a wrong time, and also after fixing that getting the same result, then...
Sorry for late reply, had a long sleep. @aussiemcgr : obeservation of a veteran. I think i am learning and implementing in a wrong way. Could u help regarding implementation of a custom table which...
hello all, i am trying to create a Custom swing table extending AbstractTableModel, the problem is no Data is shown, here is what i am trying to do, any help wud be appreciated. Thanx in advance.
...
Yeah, but in this case i have to do it without layouts :D anyway thanx for the suggestion, will try to learn more about layout managers. :D