Problem in subclass with ActionListener

Hello,
I need to program two forms which are identical except for the actions their buttons should do and some other minor differences, therefore I made a superclass for one of the forms and then extended it to build the other form. I messed up and wrote the ActionListener's as inner classes inside the superclass. Now, the buttons in the subclass react exactly the same as the buttons in the superclass. A solution I can think of is to forget about extending the class and making a different class for each form, but this would mean having two different classes with very similar code, therefore I'm sure there is a more elegant solution. Any ideas?
Thank you,
Alfredo

I believe that writing the ActionListeners as separate classes won't fix the problem, since the same ActionListeners would be called for each of the forms. The problem is how do I make the buttons in the subclass call different ActionListeners from the ones in the superclass.

Similar Messages

  • Problem possibly with actionListener

    Hello,
    I am developing a GUI appplication with Java 1.4.2 and Netbeans 5. I have created a jtree whose status changes from visible to invisible. The first time that it is visible it works correctly, the second time (after making it invisible and again visible) it doesn't work at all!!I guess that the problem is related with the actionListener. Do you have any idea how can i solve it?
    Thank you.

    Try using CardLayout.
    or add the JTree to a panel, and make the panel visible/invisible.

  • Problem parsing XML with schema when extracted from a jar file

    I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
    I get the following exception:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
    This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
    I have output the retrieved XML to a file and compared it with my original source and they are identical.
    I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
    Any suggestions?
    The code is as follows:
      public void open(File input) throws IOException, CSLXMLException {
        InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
          factory.setNamespaceAware(true);
          factory.setValidating(true);
          factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
          factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
          builder = factory.newDocumentBuilder();
          builder.setErrorHandler(new CSLXMLParseHandler());
        } catch (Exception builderException) {
          throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
        Document document = null;
        try {
          document = builder.parse(input);
        } catch (SAXException parseException) {
          throw new CSLXMLException(parseException.toString());
        }

    I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
    Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • I have an alert message in disc utility. Error: storage system verify or repair failed. Problems were found with the partitian map which might prevent booting.

    While running verify disc in disc utility on 251 GB SSD SM256c Media I came up with this message: Alert system verify or repair failed. In the descriptions box of history it said, problems were found with the partitions map which might prevent booting. This is followed by a message in red reading, Error: Storage system verify or repair failed. At the time I was down loading raw pictures off my camera through a card reader across my computer to a relatively new 2TB Western Digital portable hard drive. after about 13 to 15 pictures downloaded that drive faileded. My Mac Book Air works fine, but i get this message now everytime I run disc verify on this disc. The Macintosh HD checks out fine.

    While running verify disc in disc utility on 251 GB SSD SM256c Media I came up with this message: Alert system verify or repair failed. In the descriptions box of history it said, problems were found with the partitions map which might prevent booting. This is followed by a message in red reading, Error: Storage system verify or repair failed. At the time I was down loading raw pictures off my camera through a card reader across my computer to a relatively new 2TB Western Digital portable hard drive. after about 13 to 15 pictures downloaded that drive faileded. My Mac Book Air works fine, but i get this message now everytime I run disc verify on this disc. The Macintosh HD checks out fine.

  • Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • Why does my iPhone 4 not charge correctly?  Problem is definitely with the phone and not charges or chords.  Phone will charge but very slowly and no icon comes on.  Computer and iTunes doesn't recognize it a being connected.

    My iPhone 4 quit charging correctly.  It does charge but very slowly and icon doesn't indicate it as charging.  I've checked cables and charges and the problem is definetily with the phone.  My car stereo no longer recognizes it as a device.  Neither does the computer.  The real strange thing to me is that when I plug it into my old klispch speaker dock it will play songs.  My battery life is good when it is charged so I don't think its the battery. I've tried resetting the phone and cleaning the charging port.  I'm out of warranty.
    Would disconnecting the battery possibly reset it from some glitch or is the charging port got some bad contacts?

    I checked with the Genius Bar.  It was a new dilema to the lady that was helping me.  She took it to a back room and worked on it but it came out the same.  She gave me some options for repair or credit for replacement.
    I just kept the phone and put up with slowly charging it by plugging it in and then turning it off.
    I couldn't transfer anything from itunes.
    I finally got fed up and bought a new charging port for $10. and a toolkit for $3.  I looked up a video on youTube for the replacement and did it.
    That solved all the problems, it was the charging port, must have been some bad pins or something because it patially worked.

  • Having installed an upgrade for Photoshop Elements 13, I cannot open the application. I get an error message saying "Adobe Photoshop Elements Editor cannot be opened because of a problem. Check with the developer to make sure Adobe Photoshop Elements Edit

    Having installed an upgrade for Photoshop Elements 13, I cannot open the application. I get an error message saying "Adobe Photoshop Elements Editor cannot be opened because of a problem. Check with the developer to make sure Adobe Photoshop Elements Editor works with this version of OS X. You may need to reinstall the application. Be sure to install any available updates for the application and OS X".
    I have since uninstalled and reinstalled the app, but get the same error message.

    Which version of OS X do you have? It's not clear from your post whether "installed an upgrade" means you just installed PSE 13 as an upgrade or you installed an update to PSE 13, like ACR 9 or 13.1. Please clarify.

  • Problem when syncing with MobileMe

    I am using iPhone 3G, software 2.1. I use GMail for email (no problems) but my contacts, and only my contacts, sync through MobileMe.
    The problem is that with MobileMe active, my Contact list, "Mail, Contacts and Calendars" settings and several other minor features simply do not work - they open, pause for a few seconds, then crash. The Mail application also hangs and crashes every other time I open it.
    My local Apple Store restored 2.1, after which my Contact list and Email worked perfectly until I re-activated my MobileMe syncing, after which the problems resumed.
    As the problems occurred only after MobileMe syncing is turned on, I assume this is the cause of the problem, but because "Mail, Contacts..." settings crashes every time I open it I cannot disable MobileMe syncing.
    Any suggestions please? All help gratefully received...

    This was resolved by completely removing the MobileMe account from the iPhone, rebooting it and adding the account again.

  • Problems sending emails with iPhone 3G and outlook exchange

    I have a problem sending email with exchange. Receiving and answering mail works fine and calender updates work fine. However when I initiate an email from the phone it syncs and ends up in the sent folder in the computer but never reaches the recipient. I have tried this many times with different recipients and phones. It only happens from my iphone and ipad. Any suggestions?
    Any help much appreciated

    The iPhone you returned is still syncing against your server and locking out your account. Someone possibly has access to your mail data. I'd recommend having your Exchange Administrator install the Microsoft Exchange Server ActiveSync Web Administration Tool (http://www.microsoft.com/downloads/details.aspx?FamilyID=E6851D23-D145-4DBF-A2CC -E0B4C6301453&displaylang=en) and attempt to wipe/delete/block that other iPhone.
    Message was edited by: ethanm

  • The problem is occurred with J2ee server node which is disabled it from MMC

    Dear SAP Consultants,
    The problem is occurred with J2ee server node which is disabled J2ee server node from MMS Console and the abap work process is working fine but the dispatcher is yellow status and I can login to the abap system but Iu2019m not able to start the j2ee from Tcode u201CSmicmu201D as well
    The system parameters are:
    BI 7.0 System as ABAP & JAVA add on, windows 2003 on Oracle database, 24 GB Ram
    Paging files: Driveu201D Os system: minimum: 1525, maximum: 3048
    Driveu201DEu201D application: minimum: 70855, maximum: 70855
    I can see the log files as follow:
    From dev_disp:
    Sun Jun 21 13:10:28 2009
    J2EE server info
      start = TRUE
      state = STARTED
      pid = 2892
      argv[0] = E:\usr\sap\BWD\DVEBMGS00\exe\jcontrol.EXE
      argv[1] = E:\usr\sap\BWD\DVEBMGS00\exe\jcontrol.EXE
      argv[2] = pf=E:\usr\sap\BWD\SYS\profile\BWD_DVEBMGS00_cai-bwdev
      argv[3] = -DSAPSTART=1
      argv[4] = -DCONNECT_PORT=64990
      argv[5] = -DSAPSYSTEM=00
      argv[6] = -DSAPSYSTEMNAME=BWD
      argv[7] = -DSAPMYNAME=cai-bwdev_BWD_00
      argv[8] = -DSAPPROFILE=E:\usr\sap\BWD\SYS\profile\BWD_DVEBMGS00_cai-bwdev
      argv[9] = -DFRFC_FALLBACK=ON
      argv[10] = -DFRFC_FALLBACK_HOST=localhost
      start_lazy = 0
      start_control = SAP J2EE startup framework
    DpJ2eeStart: j2ee state = STARTED
    DpJ2eeLogin: j2ee state = CONNECTED
    Sun Jun 21 13:10:29 2009
    ***LOG Q0I=> NiIRead: recv (10054: WSAECONNRESET: Connection reset by peer) [nixxi.cpp 4424]
    ERROR => NiIRead: SiRecv failed for hdl 6 / sock 1032
        (SI_ECONN_BROKEN/10054; I4; ST; 127.0.0.1:1362) [nixxi.cpp    4424]
    DpJ2eeMsgProcess: j2ee state = CONNECTED (NIECONN_BROKEN)
    DpIJ2eeShutdown: send SIGINT to SAP J2EE startup framework (pid=2892)
    ERROR => DpProcKill: kill failed [dpntdisp.c   371]
    DpIJ2eeShutdown: j2ee state = SHUTDOWN
    Sun Jun 21 13:10:48 2009
    DpEnvCheckJ2ee: switch off j2ee start flag
    From dev_jcontrol :
    [Thr 2124] Sun Jun 21 13:10:29 2009
    [Thr 2124] *** ERROR => invalid return code of process [bootstrap] (exitcode = 66) [jstartxx.c   1642]
    [Thr 2124] JControlExecuteBootstrap: error executing bootstrap node [bootstrap] (rc = 66)
    [Thr 2124] JControlCloseProgram: started (exitcode = 66)
    [Thr 2124] JControlCloseProgram: good bye... (exitcode = 66)
    From dev_bootstrap :
    JHVM_BuildArgumentList: main method arguments of node [bootstrap]
    -> arg[  0]: com.sap.engine.bootstrap.Bootstrap
    -> arg[  1]: ./bootstrap
    -> arg[  2]: ID0072573
    -> arg[  3]: -XX:NewSize=57M
    -> arg[  4]: -XX:MaxNewSize=57M
    -> arg[  5]: -Xms256M
    -> arg[  6]: -Xmx256M
    -> arg[  7]: -XX:+DisableExplicitGC
    -> arg[  8]: -verbose:gc
    -> arg[  9]: -Djava.security.policy=.java.policy
    -> arg[ 10]: -Djava.security.egd=file:/dev/urandom
    -> arg[ 11]: -Djco.jarm=1
    [Thr 5216] JLaunchIExitJava: exit hook is called (rc = 66)
    [Thr 5216] **********************************************************************
    ERROR => The Java VM terminated with a non-zero exit code.
    Please see SAP Note 943602 , section 'J2EE Engine exit codes'
    for additional information and trouble shooting.
    [Thr 5216] JLaunchCloseProgram: good bye (exitcode = 66)
    From server.0.log :
    #1.5 #001E4F208703008A0001C7470000092000046A4414D60A1F#1242740546634#/System/Server##com.sap.caf.eu.gp.schedule.impl.ScheduleWorker#J2EE_GUEST#0##n/a##27772ea0447811deb9bf001e4f208703#SAPEngine_Application_Thread[impl:3]_25##0#0#Error#1#com.sap.caf.eu.gp.schedule.impl.ScheduleWorker#Plain###ERROR_ACQUIRE_CONNECTION
    com.sap.caf.eu.gp.base.exception.EngineException: ERROR_ACQUIRE_CONNECTION
         at com.sap.caf.eu.gp.base.db.ConnectionPoolJ2EE.getConnection(ConnectionPoolJ2EE.java:92)
         at com.sap.caf.eu.gp.schedule.impl.ScheduleDbImpl.getScheduleToProcess(ScheduleDbImpl.java:1936)
         at com.sap.caf.eu.gp.schedule.impl.ScheduleService.getScheduleToProcess(ScheduleService.java:432)
         at com.sap.caf.eu.gp.schedule.impl.ScheduleWorker.work(ScheduleWorker.java:77)
         at com.sap.caf.eu.gp.schedule.impl.ScheduleWorker.run(ScheduleWorker.java:63)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "
    cai-bwdev
    sapmnt
    BWD
    SYS
    global
    security
    data
    SecStore.properties" does not exist although it should..
         at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:59)
         at com.sap.caf.eu.gp.base.db.ConnectionPoolJ2EE.getConnection(ConnectionPoolJ2EE.java:89)
         ... 8 more
    Caused by: com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "
    cai-bwdev
    sapmnt
    BWD
    SYS
    global
    security
    data
    SecStore.properties" does not exist although it should..
         at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:193)
         at com.sap.engine.services.connector.jca.ConnectionHashSet.match(ConnectionHashSet.java:338)
         at com.sap.engine.services.connector.jca.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:267)
         at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:51)
         ... 9 more
    Caused by: com.sap.sql.log.OpenSQLException: Error while accessing secure store: File "
    cai-bwdev
    sapmnt
    BWD
    SYS
    global
    security
    data
    SecStore.properties" does not exist although it should..
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:226)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:197)
         at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:117)
         ... 12 more
    Caused by: com.sap.security.core.server.secstorefs.FileMissingException: File "
    cai-bwdev
    sapmnt
    BWD
    SYS
    global
    security
    data
    SecStore.properties" does not exist although it should.
         at com.sap.security.core.server.secstorefs.StorageHandler.openExistingStore(StorageHandler.java:372)
         at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1946)
         at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:802)
         at com.sap.sql.connect.OpenSQLConnectInfo.lookup(OpenSQLConnectInfo.java:783)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:209)
         ... 14 more
    Please advice with the right solution,
    Regards,
    Ahmed

    thanks

  • My iPhone 5 got problem when connect with lighting cable, this will keep pop up message "this accessory may not be supported"

    My iPhone 5 got problem when connect with lighting cable, this will keep pop up message "this accessory may not be supported", I can't charge or sync at all. I tried plug and unplug many time, still can't detect/charge my iPhone5, but sometime will 'lucky' that can connect to my iTunes and charge battery…
    This message will auto pop up also when I don't have plug anything in my iPhone 5, It is very annoying…
    The lighting cable is original and now i'm using OS 7.0.4 / iTunes is 11.1.3
    What I can do to fix this problem? Thank you.

    I would try using another cable you can likely borrow one to test from somebody
    if it's the same then likely the connector in your iphone have been damaged

  • Problem on copy with hp printer m127

    hi
    sorry! my english is not good
    i have a printer hp m127 and i have problem on copy with this printer
    when i copy a A4 paper from feeder or glass don't print about 1 inch of botton of page but when i scan this page, it's correct and when i print scaned document, it's correct too
    I do'nt know why this problem exists
    thanks alot
    This question was solved.
    View Solution.

    Hi @hamidjoon , and welcome to the HP Forums!
    I see you are having copy issues.  I'd like to help!
    Before we get started, I need a little info:
     I am linking a few HP Support documents below that will show you how to find which operating system you are using. Also, if you're using Windows, please include whether your operating system is 32-bit or 64-bit.
    Mac OS X: How Do I Find Which Mac OS X Version Is on My Computer?
    Which Windows operating system am I running?
    Is the Windows Version on My Computer 32-bit or 64-bit?
    Please let me know what you find.  Thanks for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • I have a problem to connect with FaceTime. I am using OS X 10.9.1 on a Mac PowerBook which is 4 weeks old. I can connect on iPhone but not from my computer.

    I have a problem to connect with FaceTime. I am using OS X 10.9.1 on a Mac PowerBook which is 4 weeks old. I can connect on iPhone but not from my computer. Does anyone have a similar problem???

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.

  • Problem polling Inbox with Sender Mail adapter

    Hi,
    I have a funny problem with Sender Mail adapter (IMAP Protocol)
    It was working fine previously.
    Now, when I poll the Inbox, 2 things happen. After re-activation:
    1. If there is a new mail in the Inbox, the Communication channel marks the mail as read, but still keeps reading the same mail into XI.
    2. If there are no new mails in the Inbox, it reads the already read mails in the Inbox one by one. So all old mails start entering XI.
    This problem exists only with the Inbox. It works fine with other folders for the same mail ID.
    Any inputs as to why this is happening?
    Regards,
    Puloma.

    Hi,
    We re-started the server and problem was solved. But we don't know why the Adapter Engine was behaving erratically.
    Regards,
    Puloma.

Maybe you are looking for

  • How can we get changed records in delta in case of numeric pointer

    Deall All, Thanks to all of you gurus i have been able to Get delta update for my query. There is one last issue how can i include changes records in my delta update when i am using numeric pointer for data selection. or It can only be doen by time s

  • Unable to see SAP standard table in HANA Studio

    Hello Experts, I have  requirement to built calculation view of SAP Standard Table like BSEG, BKPF table but i am unable to view this table in Catalog view in HANA Studio. Do i require any authorization or configuration to be done to view this table

  • Remove white space and indent code in Dreamweaver CS5

    Ive inherited some code which has loads of randomly placed spaces and line breaks. With Dreamweaver CS5 is it possible to clean up the code so its nicely indent like this?: <div>      <div>           <div>           </div>      </div> </div>

  • Power button of my iphone 5 isnt working.

    how can i resolve my problem? I took my phone to apple authorized but they refused to recall. The iPhone 5 serial number you entered is eligible for this program. Please follow the instructions below to have your sleep/wake button replaced.

  • Inserting a CS5 file in Acrobat

    This feature works with CS4 files, but I cannot get it to work with CS5 files.  Any suggestions?