Sharada Kumaran

Greenhorn
+ Follow
since May 23, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sharada Kumaran

Hey, thats a clean solution. I got the idea, but don't you think that I don't need to override Thread.stop
Is there a problem with this -
public void windowClosing(WindowEvent e){
blinker = null;
System.exit(0);
}
public void run{
while (blinker == myThread)
{
repaint();
}
I ask this because something else I read about setting the reference to null, had me confused.
thanks for your neat solution anyway!
19 years ago
You are right. A Package level class (not inner or anonymous), cannot be declared anything other than public, or else they mustn't be declared. The default accessibility will be friendly.
19 years ago
I need to stop a thread when I exit an application. I use myThread.stop(), but this is a deprecated method. Which is the correct way to terminate a thread?
The need arises because I am caling an application from another. On exiting the called application, when control returns to the first one, the thread is still running.
thanks,
19 years ago
Thanks, I was looking for a method like setLineWrap(), which I already found. The problem now is when I read from a file, if the document is formatted, with fonts, and tables, a lot of junk gets displayed in the text area. Any idea how to tackle that?
19 years ago
I am reading from a file , and appending to a TextArea/JTextArea. Right now, each line in the text area stretches on forever. Is there some property I can use to make my TextArea wrap, so that the line doesn't extend horizontally beyond the visible area?
19 years ago
The problem was with painting a string with tab characters. It cannot paint tab characters, instead it shows junk. I fixed it by replacing "\t" with " ".
19 years ago
My requirement is that I should be able to write into a file, using App1, and read from the same file using App2. I have used the same procedure that you have , Mindy, but my problem is that if my text has tab spaces ('/t'), then while reading the file, it diplays junk, where it should display tab spaces . At the time I posted the first query, it wasn't reading new line either, but I overcame that using BufferedReader.readLine()
The problem now is with diplaying tab spaces.
Here is what I am doing to read -
19 years ago
I am copying text from a TextArea and writing it into a file, using filewriter/printwriter.
The file ends up having junk characters wherever a new line should be. Why is this? and what is an elegant solution?
I also want to take this opportunity to show my gratitude to all the friendly ranchers who have helped me so much in the past. I hope I can do the same for you guys.
19 years ago
I created an application on my machine. Now I want to run it on another machine, which may not have jdk. What is the minimum my user needs to have on his machine to run this application? Assume my user has browsers, and thus jvm.
Is it enough to download jre? Are there other options?
19 years ago
I created an application on my machine. Now I want to run it on another machine, which may not have jdk. What is the minimum my user needs to have on his machine to run this application? Assume my user has browsers.
Is it enough to download jre? Are there other options?
19 years ago
I don't know if I understood your problem correctly. I had a similar requirement, where I had to display a whole paragraph.
You could substring the database string, and extract say, 50 characters into an array. and display each array element in a separate line. So, each line would display 50 characters.
Or if your string is shorter, you could change the font.
I hope this solves your problem?
19 years ago
I have an applet which draws strings in a scrolling fashion, and draws images. How can I minimise flickering?
To display the moving text , I use Thread.sleep(). After each sleep interval, I draw the line[x] at (position-1), so that each line is moving up the applet.
Can changing the sleep interval, or the position (ie. make it position - 2), eliminate flickering, or is there a better way of doing this? I can't use update(), because each time the screen must be painted fresh, or the text would overlap.
Would appreciate a speedy response.
19 years ago
My applet is supposed to read from a file, and display certain graphics. I use a file reader in the follwoing manner -
FileReader fr = new FileReader("InfoText.txt");
The applet gives the error that it cannot access file InfoText.txt
However, when I convert the same to an application, it runs fine.
What is the problem? I tried giving the complete path using file separators. "c:" + File.separator + ....
didn't work. What could the error be?

19 years ago
I want to display images on the side , and moving strings in the middle of my applet. I can a) use canvas , b) use panels c) display them directly on my applet.
What is the advantage of using either of these methods?
Mainly, I never really userstood the advantage of using canvas.
19 years ago
ooops! didn't see the previous one was already there? Does that make me a 'D', as in Donkey?
If not, here's another one -
Nice - very nice.
19 years ago