ghazanfar khan

Ranch Hand
+ Follow
since Apr 18, 2005
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 ghazanfar khan

thanks for your reply Ernest, but i can not go for the database(only when at the end of the day i go for database). Because is there another suggestion besides Database.

thanks in advance
17 years ago
Thanks James,
But i just give you an exmaple, actually i am getting real time data from 5 different exchnages. The arraylist i am creating inside method1(), it content around 40 cloumns and then added into Main arrayList.

Can please put some light on why you avoid clone. What is the reason.
Because my application running fine but at the end of the market close. It is taking too much memory but my CPU usage is around 5 to 9% only which is good but memory wise it is creating problem, like if i want to minimize my application frame or try to write some email nothing is working.

Please give me some advise.

method1(){
creating new arrylist // scope wise it is within the method scope but i am storing this arraylist reference into main reference.
might be thst is the reason.

anyways thanks, and please tryo to put some light on "why you avoid clone"

thanks
}
17 years ago
Hello everyone,
I have an application. For example
***************************************
public class A{
ArrayList _arrayList;

public A(){
_arrayList = new ArrayList();
}


public method1(){
ArrayList _arr = new ArrayList();
_arr(someValue); // which is changes everytime.
_arrayList.add(_arr);
}

}

********************************

I my application i need to call my method1() more than 50,000 times. So it create 50,000 times create new _arr object.

So my question is that if i use following method2(), so is this efficient memory wise. IS this not create new Object on memory.


public class B{
ArrayList _arrayList, _arr;

public B(){
_arrayList = new ArrayList();
_arr = new ArrayList();
}


public method2(){
ArrayList _arr1 = _arr.clone();
_arr1 (someValue); // which is changes everytime.
_arrayList.add_arr1 );
}

}
***************************************

Please give me some suggestion which one is better, using clone method in class B, instead of creating new object in class A


thanks in advance
17 years ago
Thanks for your reply, I am using the following constructor
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)

But the thing is that i want for example when you double click on any of your window's icon(Top Left Corner) so it close down that window. thay functionality i am looking that if someone double click on icon of my JInternalFrame it suppose to close that window.

thanks for your reply.
[ March 01, 2006: Message edited by: ghazanfar khan ]
18 years ago
Hello Everyone,
I have an applicaiton, in which Main Frame JFrame contain some JInternalFrame which is added into JDesktopPane. My question is that if i click on Internal Frame icon, so it is not closing the Frame but it maximize the size of the Frame. Can anyone please help me, might this is a very baisc question but i am stuck in that.

thanks in advance.
18 years ago
Thanks Todd, but is there any other way that i can go. My company is hesistant in this. I very happy if someone assit me.
thanks
18 years ago
Hello,
I have jtable, which has 8 columns. I would like to fixed the reordering of my 3 column but for the rest of columns reordering is allow.
I tried to use jtable.getTableHeader.reodering(flase);. But this comand fixed my all column which i dont want. Can any one please help me out or any sugesstion.

thanks
18 years ago
i have solved the problem, here is the solution we need to inform tableSorter by using Event Thread e.g

**********************************************************************
try{
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
tableModel.fireTableDataChanged();
}

});
}catch(InterruptedException ie){

}catch(InvocationTargetException te){

}

**********************************************************************
18 years ago
thanks John for your reply, i am using TableSorter class from sun web site. It works fine when the i have static data, but i am getting data from the stock market, so it is changing, here is the link for tableSorter

private Row[] getViewToModel() {
if (viewToModel == null) {
int tableModelRowCount = tableModel.getRowCount();
viewToModel = new Row[tableModelRowCount];
for (int row = 0; row < tableModelRowCount; row++)
{
viewToModel[row] = new Row(row); <--THIS IS THE LINE
CAUSING THE EXCEPTION
}

if (isSorting()) {
Arrays.sort(viewToModel);
}
}
return viewToModel;
}

Why would a Null Pointer Exception be occurring here if we are assigning a value???

thanks in advance
[ January 03, 2006: Message edited by: ghazanfar khan ]
18 years ago
Hello,
I have an application which frequently update and download its data from stock market, but when i pass the my table model in TableSorter it throws an eventdispatch excption, but the program wruns fine. i also calling invokeLater from my main class. Can anyone please help me why or can someone explain me wht is eventdispatch thread. I read some article on web but not get clear idea. Please help me out
thank you very much.
18 years ago
Hello everyone.
Please help me.

I am writing an Stock application, where data in every 2 second comes whether it is new data or the updated one.

my tjable grow at every second. and sometime reaches to 200000 rows. but because of the constantly downloading data my jtable is responding quickly means if i want to scroll down the scroll Bar than it repsond me after 5 to 10 seconds.
I have read one article from sun web site. Efficient Jtable , but in this only one time data is coming and than it update the downloaded dat. But in my case i ma getting in every 2 second

Can anyone please help what steps should i consider. It is very very urgent.

thanks in advance.
18 years ago
Hello Everyone,

I am developing an application like financial, in which i will get thousand of data in every 2 seconds from stock market. Someone wrote this application but it was taking so much time in performing some activity on jtable. So now it is assign me.
I am plannign that:
let say an object send me new or updated data named as "Data"

What ever Data object send me data i store it into HashMap.
than i am store this Data object into ArrayList and pass it to JTable

So, whenever user scroll the scroll bar i called that Data information from HashMap.

My Quesiton is this the right approach i am taking. Can anyone please advice me in this situation.

thanks in advance

I dont know whether this is the right way to ask but if someone help me out in this reagrd or already gown thorugh this type of situation...

thanks
18 years ago
Hello Everyone,
sorry for the subject "URGENT", actually it is really very urgent and i notice no one reply so that is why i change once again excuse me for this.

I think i can explain my problem by giving you the link as an example from sun web site. Sun Link I am trying to implement this type of jtabl and jtree combination. So far i have achieve my target.
But now i want to add multi span header. i have seen some example also here is the link for those examples Code Guru. Can anyone please help me out it is very urgent, and i am totlay lost now.

Thanks in advance.

[ November 17, 2005: Message edited by: ghazanfar khan ]

[ November 17, 2005: Message edited by: ghazanfar khan ]

[ November 17, 2005: Message edited by: ghazanfar khan ]

[ November 18, 2005: Message edited by: ghazanfar khan ]
[ November 19, 2005: Message edited by: ghazanfar khan ]
18 years ago
Thanks Michael
18 years ago
Hello Everyone,
I am trying to use JTree inside JTable cell, here is the link to an article posted on sun web site, i downloaded its source code to see how does this works but it is not compiling can anyone please do me. That how we can use them together. here is the link JTable and JTree

Thanks in advance
18 years ago