The Artima Developer Community
Sponsored Link

Java Answers Forum
static variable

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
ashwini

Posts: 2
Nickname: ash22
Registered: Nov, 2003

static variable Posted: Nov 27, 2003 8:18 PM
Reply to this message Reply
Advertisement
when do we use static variable other than for
using without creating a reference
I just declared a variable as static it was having problems but could not make out the reason then i removed the static it worked fine what is the reasonprivate static ListModel listModel;
private static JList jlist;
private static JPanel mainPanel;
private static int index;
//Do we need a variable for maintaining default model
//private static ListModel defaultModel;

public void DeviceButton(ListModel listModel,JList listRef,JPanel mainPanel,int index)
{
this.listModel = listModel;
this.jlist = listRef;
this.mainPanel = mainPanel;
this.index = index;
}

public void actionPerformed(ActionEvent ae)
{
jlist.setModel(listModel);
mainPanel.remove(jlist);
mainPanel.add(jlist,index+1);
}

}
the code is as above i anm creating a button in the main class
any solution

Topic: help needed desperetely, please!!!! Previous Topic   Next Topic Topic: how to calculate arctan( ) of a function

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use