Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

Ganesh kumar

Greenhorn
+ Follow
since Dec 26, 2008
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 Ganesh kumar

Hi,

While we loading the dynamic class and it has some new library import which in not in any of its parent classes,will that
be handled in the dynamic class loading?.Can you any one clarify me on this?. I want to load the dynamic class which might
have some new library inclusions.Can any one suggest me a good approach?.

Thank you.

Ganesh M
9 years ago
Hi,

I am drawing some lines on J Panel. On clicking any particular line i am trying to change the background
of the line with rectangle to give some high lighting effect. I am able to get the coordinates correctly.
But what ever i am trying in the mouse click event in not reflecting in the panel.I have placed the abstract
piece of code.Kindly let me know whats the mistake i am doing.Thank you.

Code Flow

9 years ago
Thanks Ulf Dittmer .

The data will vary in size for every line.So i think i cannot use RandomAccessFile. Is it feasible to use a concurrent hashmap in a following way
1) Call a reader thread from a main with the panel object as a arguement.
2) The panel object is where i will drraw some sequence based on data
3) The reader thread will read and update the concurrent hashmap.
4) At a regular interval the reader thread will call the paint method of the Jpanel.of Main thread
5) The jPanel paint method will inturn read the concurrent hashmap data and paint the sequence.

I am not sure this approach will work or not.Kindly suggest me if any other better way is there to do.Thank you.

Regards
Ganesh M
9 years ago
Hi,

I have to read a file contents which size range from 100 KB to 200MB.This file contain the data of packet transmission between the system interfaces.
So the file may contain 100 to 800000 lines (data). I have to parse each line and to draw in some format based on each line data.The file will be on the
server.I have to read it from a thin java client through servlet or web service.

As i am new to java i am not aware of IO streams. I planned in such a way
1) Using linux command through rt.exerc() and find the total lines of the file which will be sent to client.
2) The client will create the page link based on the line count (a page may display 300 data)
3) Based the page clicked i need to fetch the contents of the specified portion of the file.Suppose if user clicks
the link 20 i have fetch the file content between the lines 5700 to 6000.


Is there any way to read a specified portion of the file using line numbers with out reading the full content of the file.
Please suggest me some right way of doing this.Thank you.

Regards
Ganesh M




9 years ago
pete stein once again thanks for the reply.I was out for vacation leave.Thats why i am not able to reply soon.
Thanks for your suggestion.Now i have optimized the code for painting which works fine.The acutal problem was
the i had stored the information in hashmap,In paint procedure call i removed all the entries and once again stored the
structure.

Regards
Ganesh M
9 years ago
Hi,

Now i have progressed with the Jpanel and JApplet.Its working fine.In my case i have to do some calculation for string parsing to get some information need to be displayed along with the lines while i am drawing.This work fine for 500 to 1000 line.If it crosses above 4000 lines it slows down the application.Usually the expected line may range from 4000 to 50000.

It seems that for every scrolling it redraws the complete set of lines again.Instead of doing so is it possible to draw a specific region based on the scroll bar movement.Kindly recommend some good way of doing this.
Thanks in advance.

Regards
Ganesh
9 years ago
pete stein,I will try with what you have suggested.Thank you.

Regards
Ganesh M
9 years ago
Hi ,

Thank you Rob Prime.I will use the code tags here after.

pete stein thank you very much for that reply.I am now able to see the all the lines.I am new to java and i will use the constants as you mentioned in the post.

I have one more doubt.My requiremt is to design a applet which should draw the lines (the line is a packet transmission).When i click particular line i have to show some information on tooltip.The range of line get displayed could be 100 to 90000.I am using applet beacause it has to be viewable in both the browser and the application.My question is whether i have yo use jpane or canvas.Which one suits the above requirement in a better way.Thank you.

Regards
Ganesh M
[ December 26, 2008: Message edited by: Rayner ]
9 years ago
Hi,

I am trying to add scroll bar for a applet contains more than 5000 lines.I added the jscroll pane and set the preferred size 100000. I am able to see nearly only 1500 entries.I am not sure how to associate a scroll bar to applet to see all the lines added in applet.Appreciate the hellp.Thank you.

Code
----

[ December 26, 2008: Message edited by: Rayner ]
9 years ago