How to Serialize a JPanel which is inside a JApplet

Hi..
I have a JApplet where i have a JPanel which contains some JLabels and JTextFields,now i have to Serialize that full Panel so that i can retrived it later on with the labels and textfields placed in the same order,for that i tried serializing the full panel on to a file but it is giving me NotSerializeException,i dont know how to tackel it..
public SaveTemplate(JPanel com) {
try {
ObjectOutputStream os=new ObjectOutputStream(new FileOutputStream("Temp1.temp"));
os.writeObject(com);
catch(Exception e) {
e.printStackTrace();
This is the code..plz help me with that..

Actually its forming a Template which client will generate and that has to saved on the serverside..So what i thought that once when the client has designed a template,i can save the full template which is a panel into a file and later on when he want to open the template i just have to read the file and create an object of JPanel and add to the frame,so i dont need to apply much effort for that...But now serialization in Applet is giving problem.

Similar Messages

  • How to reference an image which is inside of ArrayList?

    Hi,
    I have an item renderer which displays an image.
    When image is loaded from file I'm just using this : <mx:Image source="...
    But how to to reffer the image data (png images) which are inside of  ArrayList ?
    Thanks!

    Taking a guess here:
    <mx:Image source="{myList.getItemAt(3)}">
    Or
    <mx:Image id="someImage">
    then in ActionScript:
    someImage.source = myList.getItemAt(3);

  • How to point to the HelpSet file which is inside a Jar

    Hi All,
    Can anyone please help me out on as to how I incorporate my help files (which are inside a jar) with JavaHelp. They are working fine when they are in a folder. But giving an error when i am trying to reference it from a jar file.
    Thanx in advance,
    Debopam.

    Hello,
    I have a little Example, and I hope this will help you.
    Melly
    * Opens the documentation in an JavaHelpViewer.
    protected void showDocumentation() {
         String jarFilePath = ".../test.jar";
         HelpSet hs = getHelpSet(jarFilePath);
         if (hs!= null) {
         HelpBroker hb = new HelpBroker(hs);
    hb.setDisplayed(true);
         else {
         System.out.error("Can't find the helpSet-file.");
    * Returns the HelpSet file which is in included into the given
    * jar file.
    * @param jarFilePath
    * @return the HelpSet file, or null, if the HelpSet file is not found.
    protected HelpSet getHelpSet(String jarFilePath) {
         HelpSet hs = null;
         try {
         String hsName = null;
         JarFile jar = new JarFile(jarFilePath);
         Enumeration entries = jar.entries();
         while (entries.hasMoreElements()) {
              ZipEntry entry = (ZipEntry) entries.nextElement();
              String entryName = entry.getName();
              if (entryName.endsWith(".hs")) {
              hsName = entryName;
              break;
         URL url[] = getURLs("file:" + jarFilePath);
         ClassLoader cl = new URLClassLoader(url);
         URL hsUrl = HelpSet.findHelpSet(cl, hsName);
         hs = new HelpSet(cl, hsUrl);
         catch (Exception exc) {
         System.out.error("Can't find a HelpSet file in: " +jarFilePath");
         hs = null;
         return hs;

  • Hey, im really sick of this, how can i open folders but in the same windows, when i open a folder which is inside of another one, it just open me a new window, its so annoying, could anyone tell me what to do? im using mac os 10.7.2

    hey, im really sick of this, how can i open folders but in the same windows, when i open a folder which is inside of another one, it just open me a new window, its so annoying, could anyone tell me what to do? im using mac os 10.7.2

    Finder > Preferences > General > Always open folders in a new window: uncheck

  • I need to run a piece of code which is inside a string object..is it possible?if so how?

    i need to run a piece of code which is inside a string object..is it possible?if so how?

    i need to run a piece of code which is inside a string object..is it possible?if so how?
    How would anyone know?
    You haven't said what 'code' you are talking about or what you mean by 'run' it.
    Since you are asking us to 'guess' what you need to do I will guess that it is a valid batch file for your OS. So just save the contents of that string to a file and then use a ProcessBuilder to 'run' it.
    See the example in the API
    ProcessBuilder (Java Platform SE 7 )

  • How to dispose a JPanel ?

    Hi,
    i want to know, how to dispose or close the JPanel from the application as well as from the memory?.
    In Simple,
    for JFrame or JInternalFrame we have .dispose(), which will remove the component from view as well as from allocated memory.
    What is the equivalant method for that in JPanel.
    Thanks in advance.
    ** Subbu **

    yeah, u r right.
    i want to remove the JPanel from the JInternalFrame which is inside the JFrame.
    well, whenever i am clicking the MenuItems i will open a new JPanel in the Internal frame.
    In order to close that panel and open a new one , i made that as JPanel.setVisible(false) and creating a new instance for the second JPanel.
    When the panel count is increasing, i should make all the opened panels as setVisible as false. i don't want to do like this.
    i don't want to hide that JPanel. I want that to be removed entirely from the application.
    Whenever i need that again, i will create a fresh instance for that.
    can u able understand my problem?
    --Subbu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to clear off Jpanel off its components?

    hai forum,
    In my project i have to select a method when textfields to enter its parameters will be displayed in a panel(which is inside a scrollpanel).
    When i select a second method(which is done using radio button) i want the previous panel screen having some text boxes to be cleared.
    Could you forum friends help me out?
    Thank you all.
    Shailesh

    Sir,
    my problem is that I have a set of methods which could be selected using radiobutton.I f i select a method as many JTextFields will be displayed in a JPanel, as there are parameters.i.e if the method has two parameters then two textfields will be displayed.These are for the users to enter their input into.
    Now ,when i select a different method then naturally the JPanel should be cleared of its previous textfields to give way for the new ones.
    So how to clear off the older ones.Just noe i tried jPanel.removeAll(); but no action seems to be done.
    shailesh

  • Why does serializable interface has no methods inside it

    Aloha
    Can anyone please help me with this....Serializable interface has no methods inside it.So how is it useful to the user.Also if I am writing a class which implements Serializable how does JVM know what to do.?

    JoachimSauer wrote:
    dannyyates wrote:
    [The JVM] doesn't know about serialisation [...]Sorry for the nitpick, but that's not completely true. The JVM needs to know about serialisation at least at little bitNo.
    since Serialization creates new objects without the code from the constructrs ever being run. ObjectInputStream loads the classes just like any other code would, although it's obviously reading the serialized stream to get that information... and then calls newInstance() on ObjectStreamClass.
    And ObjectStreamClass uses reflection to get a constructor (via java.lang.Class getDeclaredConstructor ) and then uses said java.lang.reflect.Constructor to create a new instance via newInstance()
    There is no JVM magic. It is all Java code. (With the exception of what java.lang.reflect.Constructor does because at the point it dives into sun packages but you could do the same by calling java.lang.reflect.Constructor)

  • How do i delete photos which were being imported and are now stored in a folder which i can't access

    how do i delete photos which were being imported and are now stored in a folder which i can't access

    Go to your Pictures Folder and find the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.
    Look there for a Folder called 'Import' or 'Importing'.
    Drag it to the Desktop. *Make no other changes*.
    Start iPhoto. Does that help?
    If it does then look inside that folder on your desktop. Does it contain anything you want? If not you can trash the folder.

  • How to place a JPanel at the center of another JPanel?

    Can anyone tell me how to place a JPanel inside another JPanel? The first JPanel consists of three JPanels each consisting of a label&textfield and are placed using BoxLayout. The second JPanel is a big blank screen. So, i would like to put the first JPanel at the center of second JPanel(horizontally & vertically). The problem is that i don't have any other component. So,if i try to use FlowLayout, i am able to put it at the center(horizontally, not vertically) only on the top edge. I tried to use BoxLayout. But, i couldn't(as i don't have any other elements). I tried to create some blank elements. But, they are messing up the elements of my JPanel. Any cluesssssssss??????????

    import java.awt.*;
    import javax.swing.*;
    public class CenteredLayout
        private JPanel getPanel()
            GridBagLayout gridbag = new GridBagLayout();
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            JPanel p = new JPanel(gridbag);
            addComponents(new JLabel("label 1"), new JTextField(8), p, gbc);
            addComponents(new JLabel("label 2"), new JTextField(8), p, gbc);
            addComponents(new JLabel("label 3"), new JTextField(8), p, gbc);
            JPanel panel = new JPanel(gridbag);
            panel.setBackground(Color.pink);
            gbc.anchor = GridBagConstraints.CENTER;
            gbc.insets = new Insets(0,0,0,0);
            panel.add(p, gbc);
            return panel;
        private void addComponents(Component c1, Component c2, Container c,
                                   GridBagConstraints gbc)
            gbc.anchor = GridBagConstraints.EAST;
            gbc.gridwidth = GridBagConstraints.RELATIVE;
            c.add(c1, gbc);
            gbc.anchor = GridBagConstraints.WEST;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            c.add(c2, gbc);
        public static void main(String[] args)
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new CenteredLayout().getPanel());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • How to create a region which should float in a page . (Like as windows cal)

    Hello Friends
    Using
    Apex Version 4 +.
    Oracle database 11g.
    How to create a region which should float in a page .
    ie i can move that region inside that page anywhere like as windows calculator.
    Can anyone please help me.
    Thanks in advance
    regards
    Edited by: A on Apr 13, 2011 1:48 AM
    Edited by: A on Apr 13, 2011 1:48 AM

    Hi,
    You can use a jQuery dialog.
    http://docs.jquery.com/UI/Dialog
    e.g. create html region, just say you give the region static id: floating-region, make it hidden by adding attributes: style="display: none;"then do like: $('#floating-region).dialog();
    I made another post on steps to create a dialog. See: {message:id=9506160}
    Ta,
    Trent

  • How to call jsf page which is in a seperate project

    hi,
    I am using JDEV 11.1.2.2.0 verrsion.
    how can i call jsf page which is inside the seperate project.

    Hi,
    How is the jsf page deployed? As a separate application or as part of the same application? If it is separate app, you can use the goLink method suggested by Suresh. If it is in the same app, you can create a taskflow and drop the page as view activity. Then, create an ADF Library out of the project and use it in your project where you want to call it.
    -Arun

  • How to handle user preference which has "_" and " " in the name

    Hi Experts,
    I have a question how to handle value which has like "_" and "space" etc in user preference.
    If setting "a_b-c d", I could not retrieve this because it's escaped in database.
    So this code can't get value even though I can set it.
    Is there any restriction of name? Is there any documentation how to code user prefernece which has non alphabet and number in the name?
    I know it's possible to handle the data like adding escaped data. But I don't think this is the best way to retrieve the data. Because nobody confirm it's not problem in the future.
    Could you tell me the best way to get these user preference?
    Thanks in advance,
    Masaaki Tada
    Here is a sample.
    <%@ page contentType="text/html;charset=Shift_JIS" %><%@ page language="java" import="com.plumtree.remote.portlet.*, com.plumtree.remote.prc.*, java.util.*" %>
    <%
    /** * UserInfo - Simple Page * Display User Information*/
    // VariablesIPortletContext oPortletContext = null;IPortletRequest oPortletRequest = null;IPortletUser oPortletUser = null;IPortletResponse oPortletResponse = null;IRemoteSession s;IUserManager oUser;
    /* Get Portlet Objects */
    try{oPortletContext = PortletContextFactory.createPortletContext(request, response);oPortletRequest = oPortletContext.getRequest();oPortletUser = oPortletContext.getUser();oPortletResponse = oPortletContext.getResponse();} catch (Exception e) {oPortletContext = null;oPortletRequest = null;oPortletUser = null;oPortletResponse = null;}
    String val = oPortletRequest.getSettingValue( SettingType.User, "a_b-c d" );String hoe = oPortletRequest.getSettingValue( SettingType.User, "abcd" );out.println( "a_b-c d: " + val );out.println( "abcd : " + hoe );
    oPortletResponse.setSettingValue( SettingType.User, "a_b-c d", "aiueo" );oPortletResponse.setSettingValue( SettingType.User, "abcd", "bbbb" );%>

    Plumtree recommends that user preference names have only alphanumeric characters in them (a-z, A-Z, 0-9). Any non-alphanumeric characters will be encoded by the EDK.
    I strongly suggest that you change your user pref name to something that's alphanumeric. However, if that is not possible, you can use the following workaround: in the web service editor, enter the encoded name for the user pref. There are several ways to get the encoded name.
    One way is to encode the pref manually, yourself. Plumtree uses the %u encoded format: each non alphanumeric character is converted into %uxxxx, where xxxx is the Unicode representation of the character. For all ASCII characters, just look at the ASCII hex chart. For example, character "-" has a hex value of 2d. So, a preference name "jane_pref" would be encoded to "jane%u002dpref", and you'd enter the latter value on the preferences page in the web service editor.
    The other way to find out the encoded value is to set a preference programmatically and use the HTTP tunnel tool to look at HTTP traffic between the portal server and remote server. The remote server will be sending a HTTP header to the portal server (the header name will probably be CSP-User-Pref) and inside the header you should see the pref name, encoded with %u. Just copy it out of there and into the web service editor.
    Hope this helps,
    Jane

  • How to trigger a workflow when data inside a table changes

    Hi
    How to trigger a workflow when data inside a table changes ??
    We need to trigger a workflow when STAT2 field value in PA0000 table changes.
    rgds
    Chemmanz

    Make use of Business Object BUS1065. In this business Object you have an attribute Status which you can use. There are a number of events that will get triggered when the status is changed.
    Thanks
    Arghadip

  • How to configure a scenario which posts same file to different directories

    How to configure a scenario which posts same file to different directories of a receiving system?
    Consider an Idoc to file scenario where I have to post same file to two different directories but logical receiver system has to be same.

    Hi,
    You can try out like this: Using multiple receiver interfaces you can send it to multiple directories with the help of enhanced interface determination/conditions and with the help of multiple receiver communication channels.
    Another option is to copy the file from one target directory into another directory  with the help of Unix script by executing the same from the OS command level.
    One more option is to create a Java Server Proxy and inside the proxy, you can write java code to FTP into different locations.
    Hope this helps,
    Regards,
    Moorthy

Maybe you are looking for

  • Adobe Media Encoder (Error compiling movie) Unknown error when writing to Isilon OneFS 6.5.5.18

    Adobe Media Encoder (Error compiling movie) Unknown error when writing to Isilon OneFS 6.5.5.18 while using Adobe Premiere Pro. Process:         Adobe Premiere Pro CC 2014 Path: /Applications/Adobe Premiere Pro CC 2014/Adobe Premiere Pro CC 2014.app/

  • Moving house, do I need to be in?

    Got an activation date for our house move on the 30th of the month.  Will I need to be in (does an engineer need access to the new house) on that day? Or is it all just at the exchange? Worried now as well, as Sky are the providers at the new propert

  • Logic Pro how to record bass guitar

    Logic Pro how to record bass guitar any tips?

  • Entering budget data on different levels

    Dear experts, I have a question concerning posting budget data on different levels in BCS. In Former Budgeting there was an automatic check for budget entry which was not allowing greater amounts on lower level commitment items than on higher levels.

  • QM 9.0 Can't play the recorded calls and get disappear

    Hi, CUCM System version: 9.1.2.12900-11 Unrestricted UCCX System version: 9.0.2.10000-71 QM 9.0.1.57 calls are shown in the Live monitor, then at the Recording page. but can't play nor export them, and then the calls disappear from the QM page. the f