Article View: aus.computers.java
Article #382making listener talk to class??
From: gav
Date: Thu, 30 Nov 2000 00:00
Date: Thu, 30 Nov 2000 00:00
34 lines
1884 bytes
1884 bytes
I am creating a simple Binary,hex,decimal converter.
It's classes are:
- main Gui setup class
- ActionLisenter class for when button is pressed to convert numbers
I have it all working, exept that all my GUI components declared in the
setup class are declared public.
I want (simply for the exercise) to declare these private and add
methods
to the setup class, to allow communication for the seperate
actionlistener.
eg.. at the moment my ActionListener class consists of
public void actionPerformed(ActionEvent e)
{
...
....
if(e.getSource()==main.jbutton) //main is reference to gui setup
//class that is passed when listener
//is instantiated.
...//does appropriate calculations and passes
...//results back to main Gui using set methods.
If none of this makes sence, all I'm trying to do is use a listener that
is
not a nested class. How do I make them communicate properly. Anyone
with
source code to any program doing this would be a help.
Thankyou
Any responce appreciated.
gavin.
Technical Details
Message-ID:
<3A25CFBB.DED49113@iprimus.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,d4efa0db7e96a24c,start X-Google-Attributes: gid10d6db,public From: gav <astrogav@iprimus.com.au> Subject: making listener talk to class?? Date: 2000/11/30 Message-ID: <3A25CFBB.DED49113@iprimus.com.au> X-Deja-AN: 699379087 Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: 203.134.133.254 X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: news0.optus.net.au 975556613 203.134.64.67 (Thu, 30 Nov 2000 14:56:53 EST) Organization: CWO Customer - reports relating to abuse should be sent to abuse@cwo.net.au X-Original-Trace: 30 Nov 2000 14:56:52 +1100, 203.134.133.254 MIME-Version: 1.0 Reply-To: astrogav@iprimus.com.au NNTP-Posting-Date: Thu, 30 Nov 2000 14:56:53 EST Newsgroups: aus.computers.java