Sudha Lakshman

Greenhorn
+ Follow
since Nov 26, 2001
Merit badge: grant badges
For More
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 Sudha Lakshman

Hi Jose,
The problem is that I am using java libraries V1.2 and not the latest. So I do not have the liberty of choosing classes from java.nio.
I shall anyways try it out when I get a chance.
Thanks anyways.
regards,
Sudha
19 years ago
Right now I am using RandomAccessFile, but I wanted to know if there was a better and optimal way of reading this kind of flat files.
Thank you Dhanush and Stan for your advice. Stan, I shall surely try on a Unix and Windows machine.
Guys, do let me know if you find out a better way. Thanks again.
19 years ago
hi,
I wanted a better way of reading a file. I am having a flat file with the header and trailer information. Before I can read the contents of the file, I want to read the trailer information for some validations.
I can use an input stream to read the file. but since there are more than 100000 lines between the header and trailer it would take time to reach the last of the file for the trailer information. if the validations for the trailer are not satisfied, then there is no point reading the whole file.
RandomAccessFile can be used to read the file. But, I was wondering if there was any other better way to read the file.
Any suggestions in this matter will be of great help.
Thanks and regards,
Sudha
19 years ago

Originally posted by Gregg Bolinger:
Nevermind, figured this one out too.


Can you let me know how you figured this out. Also, I wanted to know how to change the font of the accelerator "CTRL+SHIFT+E" etc to the same font as that of the JMenuItem.
thanks and regards, Sudha
20 years ago
Hi Nathan,
While using the setAccelerator() or setMnemonic() method calls, the font of these are not the same as that of the Menu item's font.
Is there a work around for this?
thanks and regards,
Sudha

Originally posted by Nathan Pruett:
Hmmm... I added in some setAccelerator() and setMnemonic() method calls and I'm not having a problem with this... I'm running JDK 1.4 on the Windows 2000 platform...

-Nate

20 years ago
Me too... first group.... it might seem a little tough in the beginning.. but later it gets better....
20 years ago
Hi,
I have built an application which uses multiple thread concept to exploit the prallelism of the processor.
This includes some GUI also. When I execute this application in WinNT system, there are a total of 17 threads running through this application. When all the threads are active, there are a total of 18 threads at a given point of time.
When I execute the same application on Windows 98, the number of threads keep increasing and after a while go beyond 100 threads when the maximum working threads should be 18 threads.
Also, there are 5 threads that are spawned in my application. How are the rest of the 12 or 13 threads accounted for?
Please help me out.
regards,
Sudha
Hi,
I have built an application which uses multiple thread concept to exploit the prallelism of the processor.
This includes some GUI also. When I execute this application in WinNT system, there are a total of 17 threads running through this application. When all the threads are active, there are a total of 18 threads at a given point of time.
When I execute the same application on Windows 98, the number of threads keep increasing and after a while go beyond 100 threads when the maximum working threads should be 18 threads.
Also, there are 5 threads that are spawned in my application. How are the rest of the 12 or 13 threads accounted for?
Please help me out.
regards,
Sudha
Hi,
i wanted to know is there any way where we can get the list of all the DSNs in a particular system using Java programming.
I tried searching for this in almost all the sites. But most of them suggest using JNI and some C/C++ dlls but the trade off with this will be support of Windows Platform only and no other. Now, this violates my application being platform independant.
Does anybody have any other way plzzzzz help me.
Regards
Sudha
21 years ago
HI Chantal Ackermann,
Thank you for your response.
You understood the problem( i was worried no one could...the way i had written).
But i kind of found out the solution even without using GridBagLayout.
All i did was set the 2nd component(the one to be aligned with its counterparts in the rest of the panels) to start from a fixed point(not using null layout).
All i did was use BoxLayout. I calculated the width of the rigid area between the two components (in my case the Label and the textfield) based on the width of the first component such that the textfield would start from the fixed point. I did not used gridbaglayout either.
Thanks for the suggestion.
regards
sudha
21 years ago
HI,
I am using BoxLayout. That seems to be fine as long as the components are not panel.
Here is what i am trying out. I have a panel (i have written it as a class called CustomPanel)
public class CustomPanel extends JPanel
{
private JLabel customLabel;
private JTextField customField;
private BoxLayout boxLayout;
public CustomPanel(String pLabelText,int pNumberOfChars)
{
customLabel = new JLabel(pLabelText);
customField = new JTextField(pNumberOfChars);
customField.setMaximumSize (customField.getPreferredSize());
boxLayout = new BoxLayout(this,BoxLayout.X_AXIS);
setLayout(boxLayout);
add(customLabel);
add(customField);
}
public void setPanelTitle(String pPanelTitle)
{
setBorder(BorderFactory.createTitledBorder(pPanelTitle));
}
}
now i use objects of this class on another panel which also is set to BoxLayout, as follows
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.util.*;
public class CustomTradingPanel extends JPanel
{
private CustomPanel customPanel;

public CustomTradingPanel()
{
setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
}
public void addComponents(String pLabelText,int pNumberOfChars)
{
CustomPanel localCustomPanel = new CustomPanel(pLabelText,pNumberOfChars);
customPanel = localCustomPanel;
customPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
add(customPanel);
add(Box.createRigidArea(new Dimension(0,5)));
}
public void setComponents(String pPanelTitle)
{
setBorder(BorderFactory.createTitledBorder(pPanelTitle));
}
}
now the problem i face is as follows :
I want to align the all the CustomPanel objects on the CustomTradingPanel such that all the customField objects are left aligned (on the same axis). How do i do that? or is there any other layout that would help me achieve this.
I do not want to use grid layout since the sizes of each component changes.
thanks in advance.
regards
Sudha
21 years ago
hi
i've a problem. i am using a JTextArea and there is a thread that is looking for an event to occur. While the thread is waiting for that event say waiting for text files, i display a message as follows
16-05-2002(12:00:00) Looking for text files.
the above message is repeated (displayed on the TextArea)after a sleep of about 1 second.
When the next message is diplayed it is temporarily displayed as
6-05-2002(12:00:01) Looking for text files.
and the "1" (the first characeter in the line)appears when the next message is displayed after 1 second.
what could be the problem???
i am using the setCaretPosition() method so that the vertical scroll bar scrolls to the new message. Could this be causing this problem???
please do let me know a solution for this ASAP.
thank you
regards
Sudha L
21 years ago
Hi Mr.Jim Yingst,
Thank you for replying so promptly and clearing my doubt.
regards
sudha
hi i had a doubt. In java if i am spawning child thread(s) from a thread other than the main thread of the program, and i stop the parent thread, will the child thread also stop? or do I have to stop the child thread explicitly?(one way of doing this is by using join() method).
In other words if i plan to interrupt the Parent thread then will the child thread also get interrupted and hence stop?
please do let me know.
regards
sudha
Hi,
Everybody knows that JDBC API can access any kind of datasource viz any database, CSV files, flatfiles, text files. I was wondering if there is any driver available that can access EDI messages? Could someone help me, if they know.
can anybody give me suggestions for any resources(articles/sites/books) etc (in case i have to implement such driver)?
Thank you.
regards,
sudha