Having trouble communicating between classes

Ok can someone just code out this simple example so I can figure it out for my project?
you have class A, B, and C
class A defines a JButton........JButton b = new JButton();
class B has some code(anything) that is excecuted when the button is pressed
class C also has some different code that is excecuted when the button is pressed
Also class C has a variable defined File file; that is used in a method in class B
basically how do you connect the classes so that they know what variables are what?

Double post.
http://forum.java.sun.com/thread.jspa?threadID=696934&tstart=0
Please be more specific on why you didn't get any useful replies from this thread (or if you just posted it here so that more people could read it).

Similar Messages

  • Having trouble understanding Abstract class. Help!!!!!!

    Having trouble understanding Abstract class. when is Abstract class used and for what.

    Having trouble understanding Abstract class. when is
    Abstract class used and for what.An abstract class is used to force the developer to provide a subclass, to implement the abstract methods, while still keeping the methods that were provided.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error 107 having troubles communicating with adobe. How I fix!?

    error 107 having troubles communicating with adobe. How I fix!?

    Where are you choosing to download the install files too?

  • I'm having trouble communicating with a transducer (Keyence LS-3100 laser scan micrometer) via the serial port. It works in Hyperterminal. Any suggestions?

    Its not a simple baud-rate or parity error. If I issue the command to send data (X1) in hyperterminal I start to get data. If I then switch to Labview I still get data. However if I try to issue the send-data command via Labview I get nothing (i.e. I can read from the device, but not write to it).
    I am on a Windows 98 (version 2) PC, running Labview 5.1.1

    Try adding a carraige return to the end of your command.
    "djb" wrote in message news:[email protected]..
    > I'm having trouble communicating with a transducer (Keyence LS-3100
    > laser scan micrometer) via the serial port. It works in
    > Hyperterminal. Any suggestions?
    >
    > Its not a simple baud-rate or parity error. If I issue the command to
    > send data (X1) in hyperterminal I start to get data. If I then switch
    > to Labview I still get data. However if I try to issue the send-data
    > command via Labview I get nothing (i.e. I can read from the device,
    > but not write to it).
    > I am on a Windows 98 (version 2) PC, running Labview 5.1.1

  • Having trouble communicating with ipod says software was not installed correctly and then asks if i want it repaired but couldnt need help

    Having trouble communicating with i pod says software was not installed correctly and asks if i want it repaired but then says could not be repaired.Installed uninstalled numerous times but nothing dont know what else to do.

    See the second box of  Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Friend Recommendations: we're having trouble communicating with the game center server and are unable to turn on friend recommendations. Does anyone know how to fix this?

    Friend Recommendations: we’re having trouble communicating with the game center server and are unable to turn on friend recommendations on our iPad. Does anyone know how to fix this?
    we also get this error message when we try to connect the iPad to Facebook from the Candy Crush Saga game..... Failed: Sorry, you  don’t have access to the Kingdom, right now. Please try connecting again later. anyone know how to fix this?

    Welcome to AD!
    I have a regular post for the top 3 or 4 fixes for that 9808 error. Obviously you are going to skip #1, since you've already tried it. Let me know how you get on with the next 2.
    The top 3 fixes to itunes error 9808 seem to be
    1) Go to Start > Control Panel > Internet Options > Advanced, make sure that SSL 3.0 is checked and TLS 1.0 is checked. Also under Security make sure that the “Check for server certificate revocation (requires restart)” is unchecked. Then click ok and fire up iTunes.
    2) The culprit was Norton. The users are set up as Admin and Standard. I have Parental Controls turned on in both Vista as well as Norton. Admin users had no problems connecting to iTunes. Standard users would get the error. I had to go to Norton’s Personal Firewall and add the program “iTunes Helper.exe” and set the option to “Allowed” (”iTunes.exe should already be in the Allowed category.) in order for the standard users to be able to connect.
    3) close iTunes if you have it open right now. Then go to C:/Documents and Settings/username/Local Settings/Application Data/Apple Computer/iTunes. Delete or cut the preferences.xml file which contains your iTunes preferences. Then go to C:/Documents and Settings/username/Application Data/Apple Computer/iTunes and delete or move the preferences.xml file. For Mac users, there is only one file you must delete or move a to a new location and is located at User > Library > Preferences > com.apple.itunes.plist. Restart iTunes and it will recreate those two (or one) files with the default settings. Feel free to set your preferences back to what they were and then connect to the iTunes store and enjoy!
    And #4, see if you can get into the iTS from a different windows admin account on the same PC.

  • Communication between classes ???

    Hi
    I am facing problems in establishing communication between java classes.
    My application consists of 4 java classes in following sequence.
    Sockets main() of java UI called JavaUI calls execute class;s func Execute()
    Client ---------------------� server---------------------------------------- -� java UI appln ------------------------------------------------------------------� execute button.
    When execute button is clicked ANT tools are called and executed. I want some mechanism by which my execute class notifies my java UI application about the successful completion of execution, which in turn tells my server and then server should acknowledge client about the same.
    How can I achieve this back ward communication in java.
    Message was edited by:
    javaUser10

    i have written a swing application in which does program does the following.
    1. Server Application (can be deploy on the server)
    a. checks an engine if it is still working by checking the database every minute
    b. if not working sends a string of message to a dedicated port
    2. Client Application()
    a. retrieves messages from the dedicated port
    b. engine has been stopped, client application can start the engine
    maybe you can do the same for your application

  • Having trouble with First Class mail

    I'm trying to use my email at school (Benito Juarez Community Academy) and also set up Gradespeed but having trouble with both.
    In composing mail, the screen will only accept a line or so and no more. I can mail that but message is incomplete. Also, can't get into Gradespeed. All I get is a multicolored pinwheel that is a security check but never stops spinning.

    See this thread: [[/en-US/questions/894442]] OWA 2010/Firefox 8 and ASHX Attachments

  • Recently got LR,and am having trouble communicating with my printer. Photos come out 1/2 bleached. Printer checked out ok. What can I do?

    Recently got LR, and am having trouble with my printer. I get "communication error" messages.Photos come out 1/2 bleached. My Epson R1900 checks out fine. What can I do?

    domh2010 wrote:
    All of that did absolutely nothing. Actually it made things worse.
    If you tried every possible solution in the all those links baltwo provided, there is nothing more anyone here can suggest other than waving a wand over the computer or you throwing salt over both shoulders. 
    Take the computer to an Apple store or an AASP.  Whichever is more convenient for you.  Let the geniuses there figure it out.  Diagnostic testing is free. 

  • Coldfusion having trouble while loading classes in Jar file

    Hi everybody.
    I have some weird problem with Coldfusion.
    I try to use a Jar file, that i put in the Coldfusion classpath. It works well (i can call some classes in the Jar file using the createObject() function ), but not every classes.
    For example,
    <cfset ServiceObject = createObject("java", "com.google.api.ads.dfp.v201204.NetworkServiceInterface")>
    <cfdump var="#ServiceObject#">
    this call works well, and i can the see the dump file.
    <cfset dfpServiceObject2 = createObject("java", "com.google.api.ads.dfp.v201204.NetworkServiceSoapBindingStub")>
    <cfdump var="#ServiceObject2#">
    This call fails, and i got a 500 error :
    ROOT CAUSE:
    java.lang.NoClassDefFoundError: Could not initialize class com.google.api.ads.dfp.v201204.NetworkServiceSoapBindingStub
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm pl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at coldfusion.runtime.java.JavaProxy.createObjectWithDefaultConstructor(JavaProxy.java:191)
    If i check in the Jar file, i can see the NetworkServiceSoapBindingStub class. Moreover, when i do the same thing directly in a java application, it works well. Nevertheless, Coldfusion is not able to load this class. How can this be possible? Do you have any idea to help me?

    I have not been able to resolve this to date. Does anyone have half a clue as to what I might be doing wrong?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alison Stohrer ([email protected]):
    Were you able to resolve this? I am having the same problem.<HR></BLOCKQUOTE>
    null

  • Java Communication Between Classes and JFrame JDialog

    i have written a standalone connect 4 game.
    next i would like to be able to play it over network and also have a chat function.
    connect 4 GUI (JFrame) holds -> connect 4 game model
    i would like to implement connect 4 network GUI(JDialog) (here the user can choose to act as a server or client) that holds Network API.
    and finally a Chat GUI (JDialog) to exchange messages.
    my question is how do i implement inter class/GUI communication? when a network message is received it ought to be delivered to the right receiver (game / chat) also messages sent from chat / game transmitted to remote machine.
    i have looked into inner classes but was told it is a bad idea to implement so much with in single class and i did not like this idea a lot either.
    i have written another game battleships in C# and it uses delegates to accomplish this task but sadly im informed that delegates are not available in Java.
    im a beginner and at the moment exploring options so im open to your guidance.
    thank you.

    Addition to my above submission
    To clarify, I'll offer the US$20 to the FIRST person who offers me a workable solution to the problem, not to everyone!!!
    JMGRAHAM

  • ITunes and iPod having trouble communicating

    Allright, first off, i have to say that when i want iTunes to show up, it takes forever for it to open.
    When iTunes DOES open when my 80GB iPod Classic is plugged in, it says the software for communicating with iPods was not installed properly. It says to reinstall iTunes. I have done this less than a week ago, only to have been shown the message AGAIN! I continue to use my iPod for a short while, and within days this problem persists... Why is iTunes being ridiculous like this for no reason? I havent changed anything my system, nothing has been changed with iTunes, its perfectly fine... Im really annoyed. I cant add music to my iPod now that it cant even show up in iTunes. Fan TASTIC!

    This refers to permissions on your computer which must have been changed. Start by using Disk Utility to repair permissions. Then do the following:
    Reset User Permissions and ACLs in Lion/Mountain Lion
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    From the Utilities menu select Terminal. At the Terminal prompt enter: resetpassword. Press RETURN. When the window opens select your startup drive where it says "Select the volume containing the user account:" At the bottom of the window you will see, "Reset Home folder permissions and ACLs." Click on the Reset button.

  • Having trouble "roundtripping" between FCP 6 and Soundtrack Pro 2

    I've been a FCP user since it first came out, and believe it or not, this is my first attempt at roundtripping with Soundtrack Pro.  Basically the process goes pretty good until it's time to go back to FCP.
    Here's my workflow:  In FCP I highlight the audio clip in the timeline.  I select Send To > Soundtrack Pro Audio File Project.  It creates a (sent) file, which I save (Save project with latest clip metadata is selected).  Once the clip opens in Soundtrack Pro, I make the adjustments I need to make (in this case, I'm getting rid of some background noise), then I save (Include Source Audio is selected).
    Here's where the problem comes in.  When I go back to FCP, I get the "Some files went offline" warning.  When I try to reconnect, I get the following warning:
    "File Attribute Mismatch
    Some attributes of one or more of the files you have chosen do not match the attributes of the original.  This may cause problems within the sequences that are dependent on them.  The attributes that differed are as follows:
    - Media Start and End
    Would you like to try to connect them again?"
    When I go to the folder where the modified (sent).stap is saved, it opens and plays back fine.  However, it looks like Soundtrack Pro is saving the full clip (from the original footage), not just the selection from my timeline.  I'm assuming this is why I'm getting the "File Mismatch" error (basically it's too long).
    Is there a step I'm missing?  Any help would be greatly appreciated!

    First thing to try is resetting your fcp preferences
    https://discussions.apple.com/docs/DOC-2491
    It's also possible your sequence has gotten corrupted.  Try editing a short clip into a new sequence and see if that works. 
    And what are your sequence settings?
    Also, although its a long shot, make sure the frame rate of your easy setup matches the frame rate of your sequence. 

  • Communicating between linked classes

    I have been struggling with what seems to be simple concept in ActionScript 3.0 - how to communicate between classes. I have a very simple experiment with two movieclips on the stage. They are named YellowBox and RedBox in my library. I have linked the following code to the YellowBox movieclip:
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class YellowBox extends MovieClip
            public function YellowBox()
                this.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
            public function rollOverHandler(event:MouseEvent):void
                this.x = x + 3;
    What I would like to do is call the YellowBox() function on my RedBox MovieClip with the following code:
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class RedBox extends MovieClip
            public function RedBox()
                YellowBox();
    I get the following message when I compile: 1136: Incorrect number of arguments.  Expected 1.
    Any help explaining the process of communicating between classes would be greatly appreciated. This experiement is just an attempt to gain a greater understand of how classes can access and use each other's methods. Thanks!
    Also, any tips on inserting code in a more readable fashion as I have seen in other posts ...

    Its a concept called Composition, where your class will use Delegation to yellow class to perform a task.
    Key Object Oriented Terms when you are ready to know more about class's and their structures
    Composition means that a class has another class in its posession, and delegation is when a class tells another to do something.

  • Troubles with inner classes in swing-panel

    hi,
    I'm having troubles using innner classes as ActionListeners in my swing-panel. I keep getting compile-time errors:
    C:\Java programmer\DocGenerator\ListPanel.java:53: cannot resolve symbol
    symbol : class Actionlistener
    location: class ListPanel.RemoveListener
         class RemoveListener implements Actionlistener {
    ^
    C:\Java programmer\DocGenerator\ListPanel.java:33: addActionListener(java.awt.event.ActionListener) in javax.swing.AbstractButton cannot be applied to (ListPanel.RemoveListener)
              removeButton.addActionListener(new RemoveListener());
    ^
    2 errors
    Here is the source code:
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class ListPanel extends JPanel implements ListSelectionListener{
         private JButton addButton = new JButton("add");     
         private JButton removeButton = new JButton("remove");
         private JButton resetButton = new JButton("reset");
         private JList list;
         private DefaultListModel listModel;
         public ListPanel(){
              listModel = new DefaultListModel();
              listModel.addElement("nummer1");
              listModel.addElement("nummer2");
              list = new JList(listModel);
              list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              list.setSelectedIndex(0);
              list.addListSelectionListener(this);
              JScrollPane listScrollPane = new JScrollPane(list);
              setLayout(new GridLayout(1,2));
              JPanel buttons = new JPanel();
              buttons.setLayout(new GridLayout(3,1));
    //          addButton.addActionListener(this);
              removeButton.addActionListener(new RemoveListener());
    //          resetButton.addActionListener(this);
              buttons.add(addButton);
              buttons.add(removeButton);
              buttons.add(resetButton);
              list.setBorder(BorderFactory.createLineBorder(Color.black,3));
              add(buttons);
              add(list);
         public void actionPerformed(ActionEvent e){
              System.out.println(e);
         public void valueChanged(ListSelectionEvent e){
         class RemoveListener implements Actionlistener {
              public void actionPerformed(ActionEvent e){
                   int index = list.getSelectedIndex();
                   listModel.remove(index);
                   int size = listModel.getSize();
                   if(size==0){
                        addButton.setEnabled(false);
                   } else {
                        if (index==listModel.getSize())
                             index--;
                        list.setSelectedIndex(index);

    Both of the errors is because Actionlistener is not the same as ActionListener. Note the capital 'L' there!

Maybe you are looking for

  • WMV's ok, but burned DVD's are poor

    If I create a slide show and preview it, the quality is poor.  If I create a WMV and play it with Windows Media Player, the quality is good.  However, if I burn a DVD of the slide show via Premiere Elements the quality is poor.  Any thoughts as to wh

  • SQL SUM and Group By Function Wrong Result

    Hi All, I have a SQL view with all the payment transaction for a property per month and trying to sum all the transactions per month per property. For some months the total is not correct. For example for property 3856, in Jan 2014, the total should

  • How to change web screen for Creation of SAP Support Message.

    Hi Experts I need assistance on the following, I need to change the web screen for Creation of SAP Support Message to the user's requirements. Technical Information About the application and component. Application:  AGS_WORK_INCIDENT_CREATE_APP Web D

  • Not show the header on the first page of a section

    I am writing a manual that has about 7 chapters. Each chapter is its own section. I have been able to go in and create a header for each of these sections very easily. However, it's not quite clear how to NOT show the header on the first page of the

  • File in IDLE mode

    I am trying to clean up an old printer installation. I am down to one file that says it cannot be opened or emptied out of the trash because it is still open. When I drag it out of the trash and try to open it, it says I need to have an application t