Is it possible to use events for objects that do not use swing or awt

Dear Experts
I want to know if events are possible with plain java objects. A simple class that is capable of firing an event and another simple class that can receive that event. My question is
1. If it is possible - then what is the approach that needs to be taken and would appreciate an example.
2. Is Observer Pattern in java going to help?
To explain further i am doing [Add,Modify,Delete,Traverse] Data tutorial using swing in Net beans. I have a ButtonState Manager class that enables and disables buttons according to a given situation. For example if add is clicked the modify button becomes Save and another becomes Cancel. The other buttons are disabled. What i want is the ButtonStateManager class to do a little further - i.e. if Save is clicked it should report to DBClass that it has to save the current record which was just added. I am foxed how this can be done or what is the right way. Thanks for reading a long message. Appreciate your help.
Best regards

Thanks Kayaman
i guess i am doing something else maybe it is crazy but i need to work further i guess... i cant post the entire code as it is too big but some snippets
public class DatabaseApplication extends javax.swing.JFrame {
    ButtonStateManager bsm;
    /** Creates new form DatabaseApplication */
    public DatabaseApplication() {
        initComponents();
        // ButtonStateManager has a HUGE constructor that takes all the buttons as argument!
        bsm = new ButtonStateManager(
                btnAdd,
                btnModify,
                btnDelete,
                btnQuit,
                btnMoveNext,
                btnMovePrevious,
                btnMoveLast,
                btnMoveFirst );One of the methods in the ButtonStateManager Class is as follows
  private void modifyButtonState()
        btnAdd.setText("Save");
        btnModify.setEnabled(false);
        btnDelete.setText("Cancel");
        btnQuit.setEnabled(false);
        ...Finally the Crazy way i was trying to do ... using EXCEPTIONS!
  void modifyClicked() throws DBAction
        if(btnModify.getText().equalsIgnoreCase("MODIFY"))
            modifyButtonState();
        else
            throw new DBAction("SaveAddedRecord");
    }And Finally how i was Tackling exceptions....
  private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {                                      
      try {
            bsm.addClicked();
        } catch (Exception e1) {
            processDBAction(e1.getMessage());
    private void processDBAction(String msg)
        if(msg.equalsIgnoreCase("SAVEMODIFIEDRECORD"))
            System.err.println(msg);
            bsm.normalButtonState();
        }Edited by: standman on Mar 30, 2011 4:51 PM

Similar Messages

  • Field value(s) for object S_SERVICE were not entered

    Hi
    Whenever I try to generate a profile in PFCG I get an error, that is saying;
    ... field value(s) for object S_SERVICE were not entered
    Number of values could be different but message text is always the same.
    The problem is in CRM2007 IDES.
    It is regardless if I try to generate for existing role (like SAP_CRM_UIU_MKT_PROFESSIONAL) or for own role
    Does anybody know how to solve such issue ?
    regards
    Rafal

    Dear Rafal,
    kindly check documentation of customizing node
      SAP Customizing Implementation Guide
        Customer Relationship Management
          UI Framework
           Business Roles
             Define Authorization Role
    "Make sure that the authorization object S_SERVICE is set to inactive.
    An active authorization object S_SERVICE could interrupt the profile
    generation."
    You have to deactivate the S_SERVICE authorization object in PFCG to
    solve the error.
    Hope this helps,
    Gerhard

  • Error: Number range  for object RESB does not exist

    Hi
    I'm trying to convert a planned order (to purch requisition) partially via trxn code MD04. Upon saving I get the above error msg. The complete text of msg is as  follows. I've maitained the number ranges of all the objects specified in this error msg. Can somebody explain on how to overcome this problem?
    Many thanks
    BE
    Error Msg Text:
    Number range  for object RESB does not exist
         Message no. 61501
    Diagnosis
         The system cannot create a document for an MRP element if no number
         range or interval has been maintained in Customizing of MRP or if t
         number range you have maintained is not allowed.
         Below is a list of MRP elements that are affected:
         Number range object  MRP element
         PLAF                 planned order (operative oder simulative)
         EBAN                 purchase requisition
         RESB                 dependent requirements
         MDSM                 simulative dependent reqmts (long-term plannin
         MDTB                 MRP list
    Procedure
         Check the number ranges in Customizing. If you do not have the necessa
         authorization, please get in touch with your systems administration.

    Hi
    Thanks for the reply. But I have maintained the number ranges for matl. reservations/dependant requirements at OMI2. Here is the screen shot..Do find anything wrong with it? Pl advice.
    NR Object                             MRES/DREQ
    No.                          From Number            To Number          Curr Number          Ext
    01                           0000000001               8999999999           380                    blank
    02                           9000000000               9500000000           blank                  checked
    RB                          9500000001               9999999999           blank                  checked
    Number ranges for the plants are assigned to 01 (0000000001 to 8999999999).
    thanks
    BE
    Edited by: Brian Elfie on Jan 10, 2008 11:27 AM

  • Number range  for object MDTB does not exist - Message no. 61501

    Hi All ,
      I have done the necessary configurations in PP say
    Order Type
    Order Type Dependent Parameters
    Scheduling parameters for planned & production order
    Confirmation parameters
    Availabilty check etc
    and iam able to create planned & production order and confirma the production order.
    I want to configure for MRP: -
    Settings done are
    Have activeted planning file entry for all plants.
    When i run MRP system throws a error <b>Number range  for object MDTB does not exist - Message no.61501 </b>
    Is there anything to do with plant parameters OPPQ and Mrp Group OPPR.
    I just tried plant parameters,standard 0001 is not available for copying.
    Suggest me how to proceed to set MRP.
    Shankar

    Hi shankar
      it is a good practice while creating the plant copying the plant from the standard plant so that all the standard table enteries will be copied  for the plant as the standard plant is not there youcan think of copying from any other plant similar to your plant which has the required entry. else
    in SE16N  check the NRIV table for the Object MDTB. if enteris found then make the table entry with the help of abaper.
    hope this helps
    regards
    SK

  • Shall i use Swing or AWT for creating a chessboard applet??

    Hi,
    I need to build an applet which should dislpay a chessboard where i should
    be able to move the pieces around, read in a game analysis, etc...
    I am a beginner and i would like some advice on if i should use swing or awt?
    Which one is it easier to work with in terms of dispaying the pieces, moving the pieces and achieving other more challenging functionalities?
    Is it good idea to mix both of them? i.e have a japplet and use a canvas for displaying the board??
    Any advice would be much obliged.

    I used to think AWT
    And someone told me Swing was better..and that all of the Drag-n-Drop stuff doesn't work well with AWT.
    I have to admit that I used AWT up until a project about 3 months ago--I liked it better, but Swing does seem to have more builtins for handling the things you would need to for the Chess Board. Not that you CAN'T do them with AWT, but that they are harder to do with AWT.
    As far as reading in game analysis, etc..that really is independent of Swing/AWT

  • Number range  for object BANF does not exist

    Hi Guru's
    I have been trying to convert the Planned orders to Purchase requisition and unfortunately the system consistantly giving me the error as reflected below  despite changing the numbering range on the affectred documents. Please help.
    Number range  for object BANF does not exist
    Message no. 61501
    Diagnosis
    The system cannot create a document for an MRP element if no number range or interval has been maintained in Customizing of MRP or if the number range you have maintained is not allowed.
    Below is a list of MRP elements that are affected:
    Number range object MRP element
    PLAF planned order (operative oder simulative)
    EBAN purchase requisition
    RESB dependent requirements
    MDSM simulative dependent reqmts (long-term planning)
    MDTB MRP list

    Hello,
    You can define number range for Purchase requistions in OMH7 transaction agaist each number range number and you assign can assign these number range number to your purchase requistion document types in SPRP >> Materials management >> Purchasing >> Purchase requistion >>Define doucment type.
    E.g for NB doc type number range number is 20
    and in OMH7 number range number 20  has interval from- 2000000000 to 2099999999
    same way
    for RV doc type number range number is 21
    and in OMH7 number range number 21  has interval from- 2100000000 to 2199999999
    Regards,
    Shailesh

  • Finder Searches for Files That Do NOT Contain Certain Words

    Is it possible to do a search in the Finder for files that do NOT contain a certain word?

    As far as I know you can't do that. It would be lovely to pipe the results of one search into another....
    What happens is if you specify a type folder, then exclude a file system name, the command excludes folders that have the word in their name.
    You may want to take a look at this:
    http://developer.apple.com/documentation/Carbon/Conceptual/SpotlightQuery/index. html
    See the section on "Query Expression Syntax" and the one on "Spotlight Metadata Attributes Reference" (click link, then click the link in the Introduction to the section). Most the other stuff is of interest mainly to programmers, but those two sections are actually useful to regular folks.
    Francine
    Francine
    Schwieder

  • Refrencing objects that are not present on frame 1 of a movieclip

    Hi everyone!
    I'm working with a movieclip right now that has two frames in it.  I want the user to be able to go back and forth between the pages by clicking on tabs on either page.  The button that they click on is only present on the frame that it is applicable (so, the button to switch to frame 2 is only present on frame 1, and vice versa).
    I want to control when they are able to click back and forth, and be able to turn the buttons on and off whenever I need to, but since the button to switch back to frame 1 is only on frame 2, when I reference it from the main timeline, the button registers as a null object.  How do I refrence an object that is not present on the first frame of a clip?
    Here's the gist of what I have.  The main timeline has an object called "mAccess" that has 2 frames, Windows and Reports.  At the top there are two tabs, one for Windows, one for Reports.  The Windows tab is only clickable when on the Reports frame (frame 2) and the Reports tab is only clickable when on the Windows frame (frame 1)
    Main Timeline:
         mAccess.bReports.addEventListener(MouseEvent.CLICK, gotoreportstab);
         function gotoreportstab(event:MouseEvent) {
              mAccess.gotoAndStop(2);
         mAccess.bWindows.addEventListener(MouseEvent.CLICK, gotowindowstab);           <---  This gives me the error about the null object reference,
         function gotowindowstab(event:MouseEvent) {                                                                 since bWindows does not exist on frame 1 of mAccess.
              mAccess.gotoAndStop(1);
    Thanks for whatever help you can give me!

    the bottomline is you can't reference an object that doesn't exist (yet).  the easiest work-around is to make sure your object exists on the frames where you need to reference it.  the object doesn't need to be visible so this isn't much extra-work.  you can add and remove the object from the displaylist as you see fit or enable and disable its visible property. 

  • How to delete webintelligence objects that are not viewed

    Hi,
    I need to find a way to delete the objects that have not been viewed in the last 12 months. We are using Business Objects XI 3.1 here. I've already looked for this feature around a lot of sites and foruns, but I still have not found anything.
    We have over than 2.500 webintelligence objetcs in our environment. A lot of them are useless. So we would like to clean up the reports that are not viewed by the users. Maybe we would use this feature one time every year.
    Thanks in advance,
    Gustavo Borges

    We decided to clean up the old documents taking a look to their last modified date. It'll be easier and we won't loose important documents. That is gonna be enough for us.
    Thanks,
    Gustavo Borges

  • Is there a solution for graphs that do not translate from Excel to PDF?

    We are working on an Excel Spreadsheet with graphs but when we create a PDF of the sheet the graph does not contain the ledger or values. Is there a solution to this problem. We have tried both printing to PDF and exporting to PDF.

    Just a note: If you want to print the PDF to paper, it may still not print correctly even though it looks correct on the PDF document- the printed graph may flow off of the paper sheet.  When you click Print, a print dialog box opens with some options and a preview.  If the preview does not look correct, change the size option to "Shrink oversized pages".  
    Jeffry Calhoun
    Workforce Analytics Manager
    Ohio Department of Job & Family Services
    P.O. Box 1618, Columbus, OH 43216-1618
    InterAgency: F376, 4020 E. 5th Avenue
    614-644-0564
    Fax 614-728-5938
    [email protected]
    OhioMeansJobs.com -
    The next best thing to having an HR department.
    OhioMeansJobs.com -
    Ohio's premier website for connecting businesses and job seekers - quickly, easily, and for free!
    >>> alscud <[email protected]> 4/9/2012 9:34 PM >>>
    Re: Is there a solution for graphs that do not translate from Excel to PDF? created by alscud ( http://forums.adobe.com/people/alscud ) in Creating, Editing & Exporting PDFs - View the full discussion ( http://forums.adobe.com/message/4323530#4323530 )
    Thank you Lori for your help your suggestion works!
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4323530#4323530
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4323530#4323530. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Creating, Editing & Exporting PDFs by email ( mailto:discussions-community-acrobat-creating__editing_%[email protected] ) or at Adobe Forums ( http://forums.adobe.com/choose-container!input.jspa?contentType=1&containerType=14&contain er=4697 )
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.
    Ohio Means Jobs
    You're looking for something unique. Use more than an ordinary site.
    http://www.ohiomeansjobs.com
    This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain private, confidential, and/or privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, employee, or agent responsible for delivering this message, please contact the sender by reply e-mail and destroy all copies of the original e-mail message.

  • This website is driving me crazy.   All I need to do is to contact a real body for help that is not listed.

    This website is driving me crazy.  All I need to do is to contact a real live body for help that is not listed.
    This shouldn't be that difficult.  GRRRRR

    Post DETAILS about the help you need here and someone may be able to help... some questions to get you started
    From the Premiere Elements Information FAQ http://forums.adobe.com/thread/1042180
    •You MUST use an account with Administrator Privileges to run Premiere Elements
    •(Doing Run as Administrator http://forums.adobe.com/thread/969395 [says Encore and also for "All" versions of Premiere] will sometimes fix "odd" errors)
    •What version of Premiere Elements? Include the minor version number (e.g., Premiere Elements 12 with the 12.0.1 update).
    •What operating system? This should include specific minor version numbers, like "Mac OSX v10.6.8"---not just "Mac"
    •Has this ever worked before?  If so, do you recall any changes you made to Premiere Elements, such as adding Plug-ins, brushes, etc.?  Did you make any changes to your system, such as updating hardware, printers or drivers; or installing/uninstalling any programs?
    •Have you installed any recent program or OS updates? (If not, you should. They fix a lot of problems.)
    •What kind(s) of image file(s)? When talking about camera raw files, include the model of camera.
    •If you are getting error message(s), what is the full text of the error message(s)?
    •What were you doing when the problem occurred?
    •What other software are you running?
    •Tell us about your computer hardware. How much RAM is installed?  How much free space is on your system (C:) drive?
    And some other questions...
    •What are you editing, and does your video have a red line over it BEFORE you do any work?
    •Which version of Quicktime do you have installed?

  • When opening certain websites or clicking links from google results, I get this popup message "Error: 'setTimeout' called on an object that does not implement i

    The message says: "Error: 'setTimeout' called on an object that does not implement interface Windows" Multiple message windows for this get open. And there is an OK button under it. I have to click on OK button on all the windows to be able to continue with working on the browser again.

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • This page contains some SWF objects that may not work properly...

    Hello Guys
    I bought this menu made by f-source into my page:
    http://beta.asphalt-driveway-sealing.com/, it's working fine except I got this message each time I am opening my file with dreamweaver CS4: 'this page contains some SWF objects that may not work properly in the most recent versions of Internet Explorer. Dreamweaver cannot  convert them to the new SWF markups. Please delete each of them and insert again' and what I did but still got this message
    the developer told me that: "I previous versions of Dreamweaver you could disable the Active
    Content Converter http://f-source.com/before_insert/
    In CS4 there is no such option."
    Please let me know what can I do then.
    Many Thanks, T&T

    Hi
    CS4 uses a 'nested' type of object code to insert swf/flv files, which is more compliant than previous code. Obviously the f-source extension is not cs4 compliant if it is changing this, (the message indicates it is doing so) and is something you should pursue via there support department. However even though it is giving you this message it should still work on live pages.
    PZ
    www.pziecina.com

  • ITunes cannot get CD track names for CDs that were not imported with iTunes

    I have a number of WAV files and MP3 files that already have album information. I would like to erase that information and have it replaced using the "Get CD Track Names" function, but keep receiving an error message of "iTunes cannot get CD track names for CDs that were not imported with iTunes." Is there some way to strip the previous information and replace it with information that iTunes receives with the "Get CD Track Names" function?

    Programs like itunes use characteristics of the CD such as track duration and sequence to identify CDs. Potentially this could be modified in a very small manner (maybe even a millisecond) in converting to a different format so maybe itunes doesn't even want to try getting the information for other formats.
    You can certainly replace whatever information you wish by "get info" on a single or multiple selection of files and entering the data by hand.

  • I have to pay for something that was not my fault, nor Verizon's fault, but is an act of God/nature.  Why is that?

    As I stated above, "I have to pay for something that was not my fault, nor Verizon's fault, but is an act of God/nature.  Why is that?"  I had a hard time keeping my phone charged at one time, so I called/visited my local retailer of Verizon, and they ordered me a new battery (first step after cleaning my phone. Not like it was dirty anyways). Got a new battery, put it in, still same problem.  Would not charge...boo! So, I bring it back, and they order me a replacement phone, since it "is still under warranty, and insured".  When I first brought my phone in, the young lady said, "That is why it is not charging; it was the charger port, that is why it was not charging. It is as loose as a goose" So, that is why she ordered me a new one. 
         So, get the new phone, put "new battery" back in.  All is good, all of what, 2 maybe 3 weeks later.  Now it is doing the same thing again. Checked the charging port, it is fine.  Bring it in, to the store, and questioned the young man behind the desk, and find out why I was charged the $299.95(+taxes & s/h). He said, "it was because the old phone was because there was "corrosion" around the port."  Of course, there was not a single note of it being loose.  He continued, and said it was because it was there had to be a time where you spilled something on it, even if it was a drop of any kind of liquid. Or, you/ or someone else, had it in the shower with them."  (Really, a drop of liquid, or taking the phone with me in the shower?)  How I could I get a "drop" of liquid in it, if I had an Otter-box on it, or why would I take it in the shower with me?  I admit, I am not the sharpest tool in the shed, but, really? Come on now!
         Since, I have to now pay for it, I am kind ‘a wondering if anyone else has, or had the same problem with their phone (s).  My wife has the same phone and she has not had this same problem.  Makes me wonder.  Since, my phone is doing this again, if it is something that I am doing wrong with it or not.  So, now they have ordered me a new battery, and we will see if this will be a new fix, or "good bye to Verizon."  Any comments, or suggestions, please email wife and me, and let me know. Thanks and God bless.

    Don't really see how this would be an act of God/nature.
    Regardless, are you saying Verizon should have to pay for those, though?

Maybe you are looking for

  • Need help restoring data after security wipe - Urgent!

    Hello, I am in need of urgent help. I had saved some really important information in the memos of my blackberry curve 8520. After that I changed my phone to a non-blackberry phone. but I still had the old phone but it was kept off most of the time. I

  • Price Updation in Sales Order

    Dear Experts, I have entered Sales Order without Price but now the time i am updating Prices of Finish Items. But in Sales Orders Partial delivered items are not being updated instead items with complete open quantity are being update. Plz Help.. Reg

  • Table contain sales org & ship to party

    Hi,   I want to develop a report to display the ship to number,ship to name,ship to address...... depending on the sales organization. is there any table that contains all the above fields. Thanks in advance. Regards.

  • HT201209 Itunes account shows 75.00 unable to use in Mac App store asked for code i no longer have

    New macBook pro I uploaded Itunes gift card by reading directly into mac.  Now see a valid balance so I trashed the gift cards.  When trying to redeem in the Mac App store it asks for a code.  Any thoughts? Ryan

  • How to know whether tomcat server is up or not..?

    I have developed a java webstart application.In that,I need to include a component in a frame that shows whether the appplication is connected to the server(tomcat) or not.If it is connected to server,then a green light is up,if not red light is up.I