Serializing a Panel...

Hi there
I want to save the content of the programmatically buttons in the Panel. However, sometimes I got the following exception and I really can't work out why. Please help I really can't work it out.
java.io.NotSerializableException: javax.swing.DefaultPopupFactory      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)      at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827)      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)      at java.awt.Window.writeObject(Window.java:1048)      at java.lang.reflect.Method.invoke(Native Method)      at java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1864)      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210)      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)      at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827)      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)      at Assignment1$5.actionPerformed(Assignment1.java:142)      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)      at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)      at java.awt.Component.processMouseEvent(Component.java:3715)      at java.awt.Component.processEvent(Component.java:3544)      at java.awt.Container.processEvent(Container.java:1164)      at java.awt.Component.dispatchEventImpl(Component.java:2593)      at java.awt.Container.dispatchEventImpl(Container.java:1213)      at java.awt.Component.dispatchEvent(Component.java:2497)      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)      at java.awt.Container.dispatchEventImpl(Container.java:1200)      at java.awt.Window.dispatchEventImpl(Window.java:926)      at java.awt.Component.dispatchEvent(Component.java:2497)      at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)      at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
My source code.
import java.awt.*;
import javax.swing.*;
import java.io.Serializable;
public interface AbstractPanel extends Serializable{
     public void addButton(String s);
     public void updateButton(String s);
     public void deleteButton();
     public void setPanel(Container content, JPanel panel3);
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.util.*;
public class BorderLayoutPanel extends JPanel implements AbstractPanel {
     private Assignment1 parent;
     protected JComboBox comboBox = new JComboBox();
     private Vector buttons = new Vector();
     public BorderLayoutPanel(Assignment1 pt) {
          super();
          parent = pt;          
          setLayout(new BorderLayout());
          TitledBorder title1 = BorderFactory.createTitledBorder("Subject JPanel");
          setBorder(title1);                    
          comboBox.addItem(BorderLayout.NORTH);
          comboBox.addItem(BorderLayout.SOUTH);
          comboBox.addItem(BorderLayout.WEST);
          comboBox.addItem(BorderLayout.EAST);
          comboBox.addItem(BorderLayout.CENTER);          
     public void addButton(String s) {
          JButton newb = new JButton(s);
          buttons.add(newb);
          newb.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent ev) {
                    parent.clicked = (JButton) ev.getSource();
                    parent.text.setText(parent.clicked.getText());
                    parent.update.setEnabled(true);
                    parent.delete.setEnabled(true);
          add(newb, ((String) comboBox.getSelectedItem()) );
          validate();
          repaint();
     public void updateButton(String s) {
          remove(parent.clicked);
          parent.clicked.setText(s);
          add(parent.clicked, ((String) parent.comboBox.getSelectedItem()) );
          parent.update.setEnabled(false);
          parent.delete.setEnabled(false);
          validate();
          repaint();
     public void deleteButton() {
          remove(parent.clicked);
          parent.update.setEnabled(false);
          parent.delete.setEnabled(false);
          validate();
          repaint();
     public void setPanel(Container content, JPanel panel3) {
          panel3.setLayout(new BorderLayout());
          panel3.add(comboBox, BorderLayout.WEST);
          content.validate();
          content.repaint();     
Thank you for any suggest and advice!
Edmond

Hi there,
I have found that after I click on the JComboBox, I will get the exception. Does anyone know if there is any special about serializing the JComboBox? Or, is there a bug in it?
Thank you!

Similar Messages

  • LV2011 problem with several front panels

    Hello,
                 There is a bug in my software and I don't know it is common to every one or not. This not to be worry, I will notify you anyway. When I open only one front panel and one block diagram which having a program to communicate with a serial device. In this case, if I choose the VISA resource name, it obviously takes some time to popup the USB and after it show the port and front panel will stay in front you until you choose the device. Here, every thing is fine but when I open several front panels and working on only with serial program front panel to choose the serial device in VISA resource name. Then after some time, it took me to another front panel. I have seen this problem several times in past two months. More, even when I am decorating the front panel and front panel took some time after pushing some controls and switched another front panel.
    Is this bug? Or I common for every one.
    Using labVIEW 2011.

    I am certainly using labVIEW from two months. So, I did not use MAX in my past time. I only used one time to check my USB 6008 device but this is off topic here. I will tell you down here.
    Suppose, If I open multiple VI's and I am only working with one VI that can communicate with my SERIAL device and the rest of the VI's(Block diagram and front panel) are rested. This case, if I click the drop downlist of "VISA resource name" of SERIAL VI, then it took some time(200ms or 100 ms, just it is a guess) to populate and it is switched to another front panel which were opened and rested before. Again, I need to come to my serial front panel again to select the COM port. This is one case.
    If don't have any other VI's not opened than this serial Vi. Then it stays on the same front panel.
    Is this bug came with labVIEW or  is it common?

  • Shop purchased photoshop elements 13 will not download to my iMac using the redemption codes.

    Hi
    I purchased this at a store called Harvey Norman here in Western Australia and after going through all the redemption code and serial number panels when I hit the down load button nothing happens.
    Although the panel with the download button tells me I have been successfully the system it will not download to my iMac. Any ideas anyone? Incidently all Adobe help panels and contacts do not respond
    or are completely opaque.

    Hi photography24,
    Please click on the download now button on the link below.
    http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements&loc=uk&wcmmode=disa bled
    If you are facing problem with Download assistant refer:  Troubleshoot Adobe Download Assistant
    To troubleshoot install refer: Troubleshoot installation | Photoshop Elements, Premiere Elements | Mac OS
    Thanks,
    Atul Saini

  • Circuit City EX470 demo model - can one buy parts to build it out?

    I bought what I thought was an HP MediaSmart Server EX470, but turned out to be a demo unit from a Circuit City that was closing.  The serial  number panel is shown below.  It's a non-functioning shell used strictly as a demo unit in stores.  Other websites mention folks with similar problems, but those were always told to simply throw it away or perhaps cut/saw/screw parts from other non-HP systems to cobble together some sort of eSata unit.
    Does anybody know of how I can purchase the necessary parts to turn this into an actual EX470 type server? 
    Message Edited by wdavis111 on 05-20-2009 02:18 PM
    Walter Davis
    Houston, TX

    I'd sell it in a heartbeat... email me privately at <text removed for privacy>
    Walter Davis
    Houston, TX

  • Download Error - Contact customer support. Indesign wont load application have gone from the control panel. CS photoshop loads and wants a serial number - and my serial number dosent work?

    Download Error - Contact customer support. Indesign wont load application have gone from the control panel. CS photoshop loads and wants a serial number - and my serial number dosent work?

    Hello Bradley,
    sometimes the "opm.db file" is the culprit. In this case you should delete it.
    But as much as I regret it and as strange as it may seem I fear it's a challenge for Adobe's Creative Cloud Cleaner Tool.
    Sometimes - for whatever reasons - CC doesn't "want" to work. In this case you should CC completely delete and reinstall by help of Adobe Creative Cloud Cleaner Tool. (A try to uninstall by own resources is not enough!)
    I quote: ... helps resolve installation problems for Adobe Creative Cloud and Adobe Creative Suite (CS3-CS6) applications. The tool removes installation records for prerelease installations of Creative Cloud or Creative Suite applications. It does not affect existing installations of previous versions of Creative Cloud or Creative Suite applications.
    Please use: http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html   and follow the prescribed sequence of operations
    If necessary and for further questions click through http://helpx.adobe.com/contact.html or http://helpx.adobe.com/de/contact.html and if "open" please use chat, I had the best experiences.
    Good luck!
    Hans-Günter

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

  • I previously had PS CS5 Trial installed but removed it using both Control Panel Programs and deleting all files from the CS5 directory on Program Files.  I then installed a purchased product from Adobe disc using the serial number on the case.  But when I

    I previously had PS CS5 Trial installed but removed it using both Control Panel Programs and deleting all files from the CS5 directory on Program Files.  I then installed a purchased product from Adobe disc using the serial number on the case.  But when I try to launch it, I get a screen headed Photoshop CS5 Extended Trial.  It asks for the serial number and says that my trial has expired.  It rejects the serial number from the Adobe case saying "This Serial Number is not valid for this product".  It thinks that I still have the expired Trial Version installed.  How do I convince it (the program) that the Trial Version is long gone and the currently installed product was installed with a valid and accepted serial number????

    Let me know how it goes. Go into your Adobe account and register your serial number asap.
    https://www.adobe.com/account/my-products-services.html
    That way, should you lose it or you need support, it is on record that it's yours and you can fetch your s/n it from anywhere.
    There are too may sad stories here, where people forgot and the box is buried or lost.
    Gene

  • Serial number front panel pop-up

    I have a vi that will scan a serial number.  It will be called from teststand.  The problem I am having that the front panel stays visable when it is executed.  This will be very distracting for the test technician.  I have attached the vi and a screen snapshot to show what I am describing.   Thanks for the help.
    Attachments:
    lvserial.pdf ‏135 KB
    scan_sc_serial_num.vi ‏42 KB

    What exact experiments did you try. Did you experiment with the TestStand - Start Modal dial and TestStand - End Modal Dialogs that are on your TestStand palette?
    Message Edited by Dennis Knutson on 05-24-2007 08:25 AM
    Attachments:
    Modal Dialog.PNG ‏6 KB

  • During serial port acess panel ist locked!

    could someone tell my why and how to change that?

    LabVIEW doesn't lock the front panel while accessing serial ports, so we'll need a lot more information about your program to diagnose your problem. Describing what you're trying to do or posting a picture of your VI's diagram might help.

  • Static VI with Visa serial functions is very slow to display front panel

    THere is a delay time of about 10-20 seconds to "display" the first VI's front panel that has Visa serial functions in the source code.
    All works fine after the first load but the initial delay of the front panel load makes it look like the PC could hang during this time. AFter this other VI's load immediately with no delay. I am concerned because I do not want to have to load a VI manually every time I start the APP which is the only workaround I can do at this time.
    Im wondering if anyone else has seen this kind of behaviour.
    I do not remember this happening until I upgraded my APP to LV7.
    DEll optiplex GX260 with 500MB RAM, Win2k and using N.I PCI-232-16 card w/ LV7 now.
    Attachments:
    RECV_LOOP.vi ‏55 KB

    I would like to resurrect this thread, as I am having the same problem. The problem stems from the VISA resource control on my front panel, because I have many COM ports registered on my system. The last suggestion from Scott B. was to "post the resulting .SPY file and I'll take a look at it". So, here is my .SPY file, and as you can see, it takes far too long. As many of these COM ports were registerd from USB converters, most of them are not actually present at this time on the system. However, even the ports that ARE present take a long time to register (i.e. COM1 is present and shows 3 seconds to register). These COM ports shown in my VISA resource do not correspond to those shown in my Device Manager, nor do they correspond to those shown in MAX under Devices and Interfaces.
    I am using LV 7.0 on WinXP SP2, with VISA version 3.2.
    OK, I just discovered something that mostly cured the delay. When I was getting the VISA version number just now, from MAX in the Software>NI-VISA item, there is a tab "VISA Options", and another tree structure in the middle pane. Selecting "General Settings>Aliases", there was a list of the old COM ports, so I cleared this list and then re-started MAX, checked again, and now only the COM ports shown in "Devices and Interfaces" matched this list (which still doesn't match my Device Manager, but no matter). When I re-opened the LabVIEW FP, it opened quickly, and the ports listed in the VISA resource matched those I saw in MAX.
    At any rate, although I just cured the symptom, the original problem of old aliases in VISA causing unacceptable delay should be fixed by NI.
    David Moerman
    TruView Technology Integration Ltd.
    P.S. the message poster didn't allow my to post a *.spy extension, so here is the *.zip of it.
    Attachments:
    Capture.zip ‏2 KB

  • Touch Panel Module clear serial

    how to clear 232 serial input and output queue in Touch Panel Module ,in Serial Compatibility VIs,there is no vi to clear serial buffer.

    Duplicate Post

  • VISA (Serial port) commands fail in the VI, but work in VISA test panel

    Hi, I have an instrument which has a usb connection. When I connect it to a Windows 7 PC, it automatically picks up the driver and shows up as a "USB Serial Port (COM7) (Manufacturer is FTDI). 
    When I open up NI MAX, this device shows up as COM7 (ASRL7::INSTR) under "Serial and Parallel". And, when I click on Open VISA Test Panel, and try the "*IDN?" command, it works OK.
    However, the VI (which just sends a VISA command "*IDN?") gives me a time out error (0XBFF0015) or a device/resource not present error ( 0XBFFF0011). Attached is a screenshot of the VI. 
    Any ideas why?
    Thanks. 
    PS: I went through the process to create the VISA-USB driver, but that has some other issue, but I am trying to understand why this occurs. This device also has a GPIB port and when I use a USB-GPIB adapter, it works very well. 
    Solved!
    Go to Solution.
    Attachments:
    problem_vi.JPG ‏24 KB

    SysB1 wrote:
    Hi, I have an instrument which has a usb connection. When I connect it to a Windows 7 PC, it automatically picks up the driver and shows up as a "USB Serial Port (COM7) (Manufacturer is FTDI). 
    When I open up NI MAX, this device shows up as COM7 (ASRL7::INSTR) under "Serial and Parallel". And, when I click on Open VISA Test Panel, and try the "*IDN?" command, it works OK.
    However, the VI (which just sends a VISA command "*IDN?") gives me a time out error (0XBFF0015) or a device/resource not present error ( 0XBFFF0011). Attached is a screenshot of the VI. 
    Any ideas why?
    Thanks. 
    PS: I went through the process to create the VISA-USB driver, but that has some other issue, but I am trying to understand why this occurs. This device also has a GPIB port and when I use a USB-GPIB adapter, it works very well. 
    Look up the examples that ship with LabVIEW.  What you have there isn't quite complete - for serial VISA.  While GPIB will work great with what you have, serial VISA requires you to configure your serial port and is a little more complicated to read.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • In Design CS2 won't accept serial number during "Personalization" In Design

    Re: InDesignCS2 rejects the serial number provided for CS2 special "no-activation" versions.
    I am having an identical set of issues as outlined in the above discussion but I am using Windows 7.
    My hard disk died and I am simply trying to get back up to speed with the new one. I have Creative Suite 2 Premium.  Following the special instructions for moving certain files so that I wouldn't have the Insert Disk 2 problems I managed to get PhotoShop actuvated and running. However, I am unable to "personalize" InDesign because the system does not like the serial number.  I have tried the one that came on the original box and the one that was on the link I used to download the programs. Both with and without the hyphens.
    I have also been unable to uninstall InDesign and start over as the wizard was interrupted just as it was described above.
    I have followed the instructions on the link you provided to manually remove CS2:  Manually remove Adobe Creative Suite 2.x | Windows  Including attempting to uninstall Creative Suite.  However, Adobe InDesign CS2, Adobe Illustrator CS2, and Adobe SVG Viewer 3 still appear in the list of programs and for some reason cannot be uninstalled using the control panel.
    In looking at the files that are still on the computer I see a folder C:\Creative Suite CS2. It has folders in it for PhotoShop, Illustrator, and Version Cue plus some other stuff. I was able to delete each of the files individually. but when I attempt to delete Illustrator, I get an error message saying  that it can't be deleted  because a folder or file is open in another application. When I attempt to uninstall that one using the control panel I get a message saying the remover was interrupted before it could finish.
    I haven't even gotten to the part of the instructions where you remove things from the registry!
    Any thoughts on where to go from here?
    Thanks,
    E.

    You need to see the following for CS2 installation:
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3 -
    http://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.htm l

  • Labview 2011 on Win7, OS causing serial loopback message corruption when clicking on top of windows?

    I'm wondering if anyone else has seen problems like this.
    I've been tearing my hair out over debugging some code. I have a ftont panel, I'm using some LEDs to send messages through the NI RS232 cable I bought, and have connected with a connector in a loopback fashion.
    I've been trying to read the incoming messages from loopback...and based on those, changing indicators and controls on the front panel.
    I could not figure why values were changing at strange times....like T's were turning to F's (I'm working with the serial data as boolean arrays).
    Well, I was simplifying code, and mostly running right...but every once in awhile, it appeared that my front panel indictors, especially the values I'm changing based on the loopback serial messages would  *BLINK*.
    I happened to be looking at the Probe Watch window...and I saw where my probes were correctly showing on a couple spots (a left and right indicator) TTTTTTTF  and TTTTTTTF......these appear at times to change T's to F's and vice versa.
    I then started clicking around...and found this is almost always caused, when I click the mouse on the top of the window...the part that you usually click and drag to move a window around the Windows desktop!!!!!!!!!!!!
    I can see this happen when I click on ANY window on the Windows OS desktop!!!!!!
    It appears that the OS is messing with me..............?
    I'm using Labview 2011, 32-bit on Win7....I believe the OS is 64 bit. 
    Has anyone seen behavior like this before?
    Thanks in advance,
    cayenne

    Matthew Kelton wrote:
    When you are probing, are you looking at the actual spot where you are getting your serial data, or are you looking at it after you've done some processing?  I would look at the actual raw data and use a serial port capture utility (there are several free ones on the internet) which will confirm your data is coming in correctly.
    What is your CPU running at?  If it is pegged at 100%, something has to give.
    Is your entire VI running in the UI execution system?  If you post your test code, it sounds like it would be easy enough for someone to do a loopback test of their own to confirm similar behavior.
    Thanks for the reply.  No, CPU isn't being hardly used at all...this is a new lenovo laptop.....high end Dell U2711 monitor...
    Task Mgr while Front Panel running:
    I'm looking after I've done some processing....
    I'm new to working with serial port stuff....I don't have a serial port capture device...?
    Thing is...when I run this in debug with breakpoints and stepping through...I don't see this happening. But when running at full speed, and especially when I click on any of the open windows on my desktop, along the top margin where you would click and drag a window around...I can see the serial data in the probe jump...and all data going through the serial port and being displayed on the front panel changing values...
    On my VI, I'm actually constructing the byte string...sending it  through the serial loopback, and receiving it and acting on it. I can see the data going in is the same as is coming out...it just seems to quickly corrupt and then come back again...like maybe it is getting interrupted by the Win7 OS....?
    I can't really post the whole code here...proprietary stuff...that's why in the past, I was posting a separate, simpler vi with only the parts I was having problems with....
    I think I have full support with NI...I wonder if I could send them the code to look at, with more confidentiality...?
    But again, I can make the problems happen, when it and the probe window is open, in real time...by clicking on windows.
    Also, this tends to explain problems I saw earlier...when running slow, all was well , when debugging with break points and stepping through. But at full speed, unexplained...things would start resetting without explanation...and without regularity.
    C
    I"m not sure what you are asking with "Is your entire VI running in the UI execution system?"....I have the one vi running, and only that vi is running.....

  • CS4 suite serial number does not work for Adobe Acrobat Pro

    Hello,
    I am looking for a solution for the serial number issue I am having with Adobe Acrobat Pro. All of other programs within the suite open fine, but when I open Adobe Acrobat Pro it asks for a serial number. When I type in the serial number, I am given a red "X".
    I have called customer support, but they haven't been able to give me any information that will resolve my issue (uninstalled 4 times now). I have Vista and have looked online and on the Adobe website to find a solution. It looks like others are having the same issue from what I can tell while searching. I have run the script too and then reinstalled, but still nothing.

    After some stupid upgrade in my computer (who knows as Microsoft is always doing something), my Acrobat 9 in CS4 stopped working. The error message said to uninstall and reinstall Acrobat. So I went through the control panel and uninstalled it. I then loaded the CD and reinstalled. However the reinstall would NOT accept the orginal serial number. I called Adobe and they gave me a different serial number. Before I let the guy nof the line I tried the  number and it did NOT work! So then he gave me another number which  asked for the previous verison- apparently it was an upgrade number. Luckily I had my old CS3 software and I gave it that number and then it accepted the install. The program now works BUT there is no longer any ADD/REMOVE choice in the CS4 suite in the control panel. There is no way to automatically remove this program anymore! What a mess.
    After reading some of the installation problems others have had and no solutions, I count myself lucky! At least I was able to get the program running.
    Therefore my advise on the serial number problem is to get Adobe on the phonen and get them to give you a number that will work, and don't hang up until you know the program is working!
    If anyone knows how to add the Acrobat to the the add/remove functions in the control panel, please let me know!

Maybe you are looking for