JApplet - maintaining state?

Dear users,
I'm am developing a JApplet with two JPanels on it. One of the panels has buttons and a textarea on it, and the other one is where i do some painting. It works wonderfully on my local machine. However, i have some problems when deploying it on a web server.
As this applet reads certain files on the server before getting started, i had signed the applet properly and have uploaded it. It does not throw any exceptions and loads properly, meaning that it is able to read the files it wants. But while painting, i check if one of the hashtables has atleast one record in it. if it has, painting will proceed. if it doesnt, an error string will be painted on the JPanel. And now, my problem is, even with correct input (which is likely to put a couple of entries in the hashtable), my applet shows the error string.
while debugging, i tried to populate the textarea with the contents of one of the files i'm trying to read. and this does not happen either. no exceptions are thrown. i'm lost.
please have a look at this to know what i'm talking about
http://www.mrc-lmb.cam.ac.uk/genomes/pkota/ncit/SliceIt.html
my misery doesnt end here. when i scroll down the page, even the error string that is getting painted, disappears. how do i block that call to repaint() and maintain the so-called "state" ?
any help is greatly appreciated.
kota.

getCodeBase() returns only the URL where the applet classes are located. But how do you download the data files ? With Applet.getImage() or HttpURLConnection ?
If the applet works locally I recommend to put some debug messages (with System.out.println() ) in your code and activate the Java console for the Java plugin to find the problem.

Similar Messages

  • Maintain state in Proxy

    Is there a way to maintain state in ABAP server proxy across calls, like http session.
    What about java proxy?
    Thanks

    This is a scenario where XI calls into R3 proxy via inbound interface. I need to collect data across 3 calls and then write to the database. Yes I could move the logic to BPM, but I want to see if there is an option of have state in server proxy,  if so I might be able eliminate BPM.
    Thanks

  • What is the best way to maintain state in Java web apps?

    Hi,
    been looking at best way to maintain state between requests in JSP.
    Ive been trying to use URL rewriting but been getting problems. I understand I can also achieve this using cookies.
    Are there any other better ways of doing this.
    I don�t know if the problem is with JBuilder4 or something in the Tomcat server?
    Any suggestions would be appreciated.
    thanks.

    I think if you use JavaBeans that implements Serializable , it might maintain state (but not sure of this).
    HttpSession is one option but , sessions have limitations - they timeout, they don't work when the page is cached by the browser and they don't work if Cookies are disabled in the browser.
    Database is always an option, and there are two types of DBs , in-memory like HSQLDB etc , or the regular RDBMS like MySQL , Oracle etc.
    If you only want to maintain state between HttpRequests, then use the request object which is implicit in JSPs.
    I think your URL Encoding is not working most likely because you have disabled Cookies in your browser and that's why you see jsessionid.
    If you enable Cookies in your browser then, the jsessionid should not appear.
    There are other options I'm sure, but I'm only aware of the above at this time.... may be someone else might know more.

  • Maintaining State with OAS 4.8 and PL/SQL

    Hi,
    I am working on a package that displays 5 pages with 83 application questions. To maintain state for all 83 questions, I am using a procedure that maintains the data on a string (~400 characters) and passes it to each page (We decided to avoid writing to the database before the application is completed). Since the pages were expiring randomly, I added NEXT and PREVIOUS buttons. One procedure, the one that maintains the string, has 83 parameters.
    The package contains 8-10 procedures, 180 constants and global variables (we tried without using global variables but global variables make the code easier to read and the package smaller (around 4000 lines). The complete application uses 4 packages.
    During development, the package seemed to be working well, until I added more realistic data. Right now, I get The error message: The page cannot be found. The first time, I got this message, just by pressing enter again will cause the page to display. At times it will take 3 or 4 times pressing the enter key on the URL. Slowly, it became more and more difficult to make the browser display the first page. Today, no matter how many times I press the enter key, the page does not display.
    Questions:
    1. Are there any limits on parameters, global variables and data on OAS 4.08. I tested reducing the package parameters, global variables and data to half the size, but the procedure still does not display. Compiling an older copy of the procedure does not seem to work either.
    2. Is there a better way to maintain state without writing to the database?
    I am not sure what is causing the problem. I have an open TAR.
    null

    Patricia Blais (guest) wrote:
    : I have bought the book "The complete reference SQL" which came
    : with a trial software CD of Oracle 8. I want to know if it is
    : possible to create a program in PL/SQL (create a procedure) in
    : SQLPLUS v.8 which is also included with the book. If it is
    : possible, I would like to know how, by a small example. I have
    : tried some of the exercices in the volume and they do not
    work.
    : No error messages are given and the program had to be
    : interrupted. Please answer in another way then repeating an
    : example in the book.
    : Thanks in advance.
    ok some code example:
    Let's gues you want to display 2 collums of the view all_tables
    in html format:
    First create a procedure with a editor (i use to do so).
    create or replace procedure get_html (owner_in in varchar2) as
    var1 number(12,0);
    var2 varchar2(100);
    begin
    dbms_output.putline('<table>');
    for fr_rec in (
    select table_name, owner
    from all_tables
    where owner like '%'

  • Maintaining State For Item Renderers

    Hey guys,
                    I have a custom item renderer CustomRenderer.as and CustomRendererData.as. The item renderer component has a loading animation and each renderer reads the loading percent , wether its in Uploading state and the color of the progressbar from the data class . The issue I run into is when these animations are playing and the user is dragging and dropping them sometimes the progress bar does not maintain its state , animation plays again or has a color from the previous item renderer .
    When you click the LoadData button the animations will start and if you start to drag and drop them around you can see sometimes the states gets confused for example
    data1 is red
    data2 is green
    data3 is blue
    data4 never loads because its isUploading property is false
    Sometimes data4 will have the progress bar animating even though it should never animate or data3 would have a red progress bar. I have attached the source as a zip file and a image of the error state. Any help is much appreciated. Thanks
    Below is the custom Item renderer class CustomRenderer.as
    package
         import flash.geom.ColorTransform;
         import gs.TweenLite;
         import mx.controls.Label;
         import mx.controls.listClasses.IListItemRenderer;
         import mx.core.FlexShape;
         import mx.core.IDataRenderer;
         import mx.core.UIComponent;
         public class CustomRenderer extends UIComponent implements IListItemRenderer, IDataRenderer
              protected var _progressBar:FlexShape;
              protected var _data:CustomRendererData;
              protected var _percentValue:int;
              protected var _percentChanged:Boolean;
              protected var _progressBarTween:TweenLite;
              protected var _title:Label;
              protected var _titleValue:String;
              protected var _titleChanged:Boolean;
              protected var _uploadingChanged:Boolean;          
              public function CustomRenderer()
                   super();
              override protected function createChildren():void
                   super.createChildren();
                   if (!_progressBar)
                        _progressBar=new FlexShape();                    
                        _progressBar.x=_progressBar.y=4;
                        __drawProgressBar();
                        addChild(_progressBar);
                   if (!_title)
                        _title=new Label();
                        _title.setActualSize(100,22);                    
                        _title.x=4;
                        _title.y=120;     
                        _title.text ="data";
                        _title.setStyle("color" , 0xffffff);               
                        addChild(_title);
                   this.graphics.beginFill(0x333333, 1);
                   this.graphics.drawRect(0, 0, 124, 148);
                   this.graphics.endFill();
                   _percentChanged = false;
                   _titleChanged = false;
                   _uploadingChanged = false;
                   _percentValue = 0;
              private function __drawProgressBar():void
                   _progressBar.graphics.beginFill(0xffffff, 1);
                   _progressBar.graphics.drawRect(0, 0, 1, 87);
                   _progressBar.graphics.endFill();
                   _progressBar.width=0;
              override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                   super.updateDisplayList(unscaledWidth, unscaledHeight);
              override protected function commitProperties():void
                   super.commitProperties();
                   if (_data)
                        if(_percentChanged && _data.isUploading == true)
                             _percentChanged = false;
                             if(_progressBarTween)
                                  TweenLite.removeTween(_progressBarTween);                                        
                             var colorTransform:ColorTransform;
                             colorTransform=_progressBar.transform.colorTransform;
                             colorTransform.color = _data.color;
                             _progressBar.transform.colorTransform=colorTransform;     
                             const newWidth:int = Math.round((_data.percent * 116) / 100);
                             _progressBarTween=TweenLite.to(_progressBar, _data.time, {width:newWidth});                         
                        if(_titleChanged)
                             _titleChanged = false;
                             _title.text = _titleValue;
              public function set data(obj:Object):void
                   _data=obj as CustomRendererData;
                   if(_data)
                        if(_data.percent != _percentValue)
                             _percentValue = _data.percent;                         
                             _percentChanged = true;
                        if(_titleValue != _data.title)
                             _titleValue = _data.title;                         
                             _titleChanged = true;
                   invalidateProperties();
                   invalidateDisplayList();
              public function get data():Object
                   return _data;
              override protected function measure():void
                   super.measure();
                   measuredWidth=124;
                   measuredHeight=148;
                   measuredMinWidth=124;
                   measuredMinHeight=148;
    This is the data class CustomRendererData.as
    package
         [Bindable]
         public class CustomRendererData
              public var percent:int=0;
              public var title:String;
              public var color:uint;
              public var time:int;
              public var isUploading:Boolean = false;          
              public function CustomRendererData(){}
    Main application class CustomTileList.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                        layout="vertical"
                        xmlns:local="*" applicationComplete="init();" height="375">
         <mx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   public var data1:CustomRendererData = new CustomRendererData();
                   public var data2:CustomRendererData = new CustomRendererData();
                   public var data3:CustomRendererData = new CustomRendererData();
                   public var data4:CustomRendererData = new CustomRendererData();
                   [Bindable]
                   public var coll:ArrayCollection=new ArrayCollection([data1, data2, data3, data4]);
                   private function init():void
                        data1.title ="data1";
                        data1.color = 0xff0000;
                        data1.time = 8;
                        data1.isUploading = true;
                        data2.title ="data2";
                        data2.color = 0x00ff00;
                        data2.time = 11;
                        data2.isUploading = true;
                        data3.title ="data3";
                        data3.color = 0x0000ff;
                        data3.time = 9;
                        data3.isUploading = true;
                        data4.title ="data4";
                        data4.color = 0x00ffff;
                        data4.time = 2;
                        data4.isUploading = false;
                   public function itemClick():void
                        trace(list.selectedIndex);
              ]]>
         </mx:Script>
         <mx:TileList id="list"
                              itemRenderer="CustomRenderer"
                              width="640"
                              height="228"
                              verticalScrollPolicy="off"
                              useRollOver="false"
                              dataProvider="{coll}"
                              columnWidth="150"
                              itemClick="itemClick();"
                              dropEnabled="true"
                              dragEnabled="true"
                              dragMoveEnabled="true">
         </mx:TileList>
         <mx:Button label="LoadData" click="{data1.percent=100;data3.percent=100;data2.percent=100;}"/>
    </mx:Application>

    Yes, they are kinda tough. I claim no expertise, but have
    managed to get them working by using the examples of others.
    Does that exaple not work for you? Here is another:
    http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectID=575
    For general info on the construction, and the overridden set
    data() and updateDisplayList() methods, you will just need to study
    the documentation.
    Tracy

  • Maintain State of a Tree Table

    Hi,
    I am using Tree Table with EJB Datacontrol. I am fetching child records on Disclose icon of a treetable. I have added context menu on tree table to navigate to another taskflow. I want to maintain the same state i.e. Tree Table should be in Expanded State for those nodes which were disclosed by user previously) of a tree table when use clicke on Back button of a another taskflow.

    Hi Bill,
    I think that that is the only example I've seen of anyone storing tree node selections.
    The only other thing that springs to mind would be to use a "region pull" and put the report on another page and have the click of a node trigger the Ajax call that sets a PK value (or whatever would be required for a report) and then pulls the report into a DIV on the tree's page. That way, the page isn't even reloaded. Of course, that is for a report - not sure if it would work ok for forms
    Andy

  • Maintaining state on URLConnection - possible?

    Does anyone know if it's possible to maintain the state of a URL connection, for example I have this code to download the HTML of a web page:
                try
                    URL yahoo = new URL("http://www.yahoo.com/");
                    URLConnection yc = yahoo.openConnection();
                    BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream() ) );
                    String inputLine;
                    while ((inputLine = in.readLine()) != null)
                        System.out.println(inputLine);
                    in.close();
                } catch (IOException e) {
                    System.out.println(e);
                }and I see this image that I want to download:
    <img src="http://us.a1.yimg.com/us.yimg.com/i/ww/beta/y3.gif" width="232" height="44" alt="Yahoo!" title="Yahoo">
    Can it be done using the same connection so that the state is maintained?
    Can I send data back using the same connection so that the state is maintained? for example if the image is a verification image that the user needs to enter?
    Thanks
    BBB

    OK lol, fair enough. What I'm trying to do is create a login system to a website from within a Java app, I want to display the username and password fields in a Java GUI and submit these to the website. What I'm also trying to fathom out is how I can display the verification image - I can easily download the image content and display it in my Java app, however I think the way CAPTCHA images work is by storing a cookie on my PC with either the CAPTCHA code, or a session ID so it can identify that I entered the correct code once I post the values back. Any idea how I might go about this?
    Once I have the username, password, and CAPTHCA, how do I post this information to the website?
    Sorry about the newbie type questions, but I've never done anything like this before, and any help would be appreciated.
    And before someone asks, no, I'm not creating a spam robot or anything alike; I have a genuine requirement to SHOW a loging form from with a Java GUI which posts information to a website.

  • Layer palette not maintaining state, what to do??

    Problem: Layer palette chages state between the closing and reopening of a file.
    What I would like to be able to do is open a .ai file and have the layer palette exactly the way the way I left it when I closed the file. Currently upon reopening a file many of the layers will be fully expanded and I have to go through and collapse them all.
    Is there a way to force Illustrator to maintain layer palette state between file sessions?
    Thanks.

    The behaviour - or the issue - has been introduced in Illustrator 9, the first version which included nested layers. The behaviour has been legitimately criticised pretty often.
    However, if you want to collapse/expand all layers in one step you might consider converting your main layers into sublayers. That is:
    • Create a new 'master layer' on top of the entire stack of main layers
    • Drag all main layers onto the master layer in order to make them sub layers of the master layer
    • Now you can Alt/Option Click the triangle on the left-hand side of the master layer in order to collapse or expand all sublayers
    Of course, this way is only applicable if using sublayers is an option for you.

  • Maintaining state of changed style properties

    I display a page with a number of sections with style="display: none" so they initially are not displayed.
    The form functions like a questionaire so depending on the choices users make a section might get displayed by changing display= none to display="" in javascript..
    After pressing the submit button, the page sections fall back
    to the original style setting display=none.
    Can somebody point me in the right direction on how to maintain the style state of these page sections?

    The way I'd approach your problem is by setting boolean properties in the session bean, and binding the "rendered" property of each object to the bean property. (Reply in the topic if you need more detailed instructions on how to do this)
    In the action() or processValueChange() method you can then put the logic to decide what needs to be displayed, and toggle appropriately the session bean properties (e.g. getSessionBean1().setRenderedProperty1(true)).
    Hth,
    Luca

  • How to maintain state in multi select form. ( ASP classic )

    I have a mutli select form fields e.g.:
    <select name="Location" multiple="multiple" >
    <option value="8">Anglesey</option>
    <option value="11">Cheshire</option>
    <option value="5">Conwy</option>
    </select>
    say i select the first 2 of the 3 options and submit my page
    e.g. :
    mypage.asp?Location=8&Location=11
    how would i then set the state of the options to selected
    e.g. :
    <option value="8"
    selected="selected">Anglesey</option>
    <option value="11"
    selected="selected">Cheshire</option>
    <option value="5">Conwy</option>
    help and suggestions appreciated

    Hi Arvind, your best bet might be to pass the filter value via a QueryString and then apply a QueryString filter to those other pages. Overview of QueryString Filters:
    http://office.microsoft.com/en-us/sharepoint-server-help/connect-a-query-string-url-filter-web-part-to-another-web-part-HA010250999.aspx (I know it's for 2007, but the same applies to 2013).
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Can FireFox addons maintain state, inspect tab content and have control over the browser independently?

    Hello,
    I have a question about developing FireFox extensions, i.e., what exactly are they capable of.
    I'd like to automate my work on a certain web application, that spans across multiple sub-pages on a single domain (just like a regular website).
    Will a FireFox addon be able to control the browser's behavior? I.e. will it be able to follow links and keep its internal state separate from the web document? (E.g. I am pretty sure Google Chrome extensions sometimes restart themselves once the page they were working on is reloaded.)
    Basically I would like to create an addon/extension that has some internal state, is able to interact with the web page, and is able to reload the webpage/do whatever it likes in the tab.
    Can FireFox addons/extensions do that?

    Try to ask advice at the MozillaZine Extension Development forum.
    * http://forums.mozillazine.org/viewforum.php?f=19
    You need to register at the MozillaZine forum site in order to post at that forum.

  • IE 11 not maintaining state

    Just had the IE 11 update pushed to my development box.  Now, on the site I am working on, I am getting a new cfid/cftoken with every page request, ruining state/session management.
    What is the easiest work around on this?  I would hate to have to go through all the site adding #cfid# and #cftoken# to every url...
    Also, if I do have to append cfid/cftoken, how is it handled when the site is indexed by a se bot?  Wouldn't the cached links have the same cfid/cftoken for everyone?
    Thank you.

    Ensure IE is allowing cookies to be set.  There's probably a security/privacy setting that's just preventing this; IE is a horrible browser, but I cannot see it just blindly refusing to store session data.
    There is a function called URLSessionFormat which you can wrap around all your links, and CF will determine if the client can support cookies or not; if so, it will append nothing to the URL, but if they cannot, it will add the needed variables to the URL passed to it in order to add the CFID/CFTOKEN as needed.
    Also, you don't want to send session data to any resource that does not modify or restrict its content by user.  For example, you send a session data to the base request because it needs to know who you are through subsequent requests, but you don't want to append the CFID and CFTOKEN data to resources that don't care who you are and just serve data.  Like Images, Scripts and Styles.
    In fact, a way of optimizing an application often involves moving said resources to separate hosts who are setup to not even accept cookie data; that way, even the request to the resource is minimal (smaller request headers).  For such resources, simply do not enclose them in the URLSessionFormat() BIF.

  • Problem with Maintaining State with EJB3 Stateful Bean

    I'm a newbie in EJB3. I've wrote a Stateful bean together with JSF as the UI tier. Below is my Stateful bean.
    package com.dhydrated.business;
    import com.dhydrated.entity.User;
    import java.io.Serializable;
    import javax.ejb.Remove;
    import javax.ejb.Stateful;
    @Stateful
    public class LogonBean
            implements LogonRemote, Serializable {
        private User user;
        public void setUser(User user) {
            this.user = user;
        public User getUser() {
            return user;
    }In above code, I'm storing User object as the private variable. The problem is, whenever I set the User object in the 1st page, I'm unable to retrieve the same user object in the 2nd page. Seems like my Stateful bean does not saved the state or conversation of the bean.
    Appreciate if someone could tell me on how to save the state of above Stateful bean. Is there some other conf. that I might missed out?

    I was find good solution! =)
    *** JScript ***
    <script TYPE="text/javascript">
    <!--
    function popup(myform)
    if (! window.focus) return true;
    var d = new Date();
    windowname = d.getTime();
    window.open('', windowname, 'top=100,left=100,height=200,width=200,location=no,resizable=no,scrollbars=no,status=no');
    myform.target=windowname;
    return true;
    -->
    </script>
    *** JSF ***
    <h:form onsubmit="popup(this)">
    <h:commandButton value="Press Me" actionListener="#{sessionBean.resetCursor}" action="selectElemList" />
    </h:form>
    But it work only with <h:commandButton> tag. If you try to use <h:commandLink>, then 'onsubmit' attribute by <form> tag don't work.
    If you know how make necessary functional with <h:commandLink> tag, please let me know.

  • Okay I am stuck with figruing out Maintain State on Buttons

    Can someone help me with maintaing state of Check Boxes. I am new to JSP and still learning. I know I need to user a TLD file to use a Java file to get and set the Check Boxes values and check if they are checked. However, I guess I am looking for maybe a good web site with a references or an example. Please not the Article on Sun's I tried cannot follow that example. Thanks

    Can someone help me with maintaing state of Check Boxes. I am new to JSP and still learning. I know I need to user a TLD file to use a Java file to get and set the Check Boxes values and check if they are checked. However, I guess I am looking for maybe a good web site with a references or an example. Please not the Article on Sun's I tried cannot follow that example. Thanks

  • LoginContest maintains state?

    I have written a custom LoginModule to authenticate a client's x509 certificate against OID. My client is a java class that calls a jsp page - the jsp page grabs the cert info and calls the LoginContext as follows:
    LoginContext lc = null;
    Subject subject = null;
    try {
         subject = new Subject();
         subject.getPrincipals().add(principal);
         lc = new LoginContext("findcert", subject);
         lc.login();
    ... etc ...
    the issue is this: I restart oc4j and run this - everything is cool. the initialize() method of my loginmodule class is called as expected. However, the 2nd time i run it, the initialize() method is NOT called...so my LoginModule object always sees the same subject.
    what am i doing wrong? i greatly appreciate any help.
    chris

    Scott,
    Yes, I'd done this. I've solved the problem by deleting the Submit button and creating a new one. It seems there was something wrong with the original one.
    Thanks for your time Scott.
    Marshall

Maybe you are looking for

  • UNABLE TO REQUEST FOR DOWN PAYMENT IN AP

    Hello, I have a problem of unable to request NEW ITEM for Down payment in A/P. Recieved an error: NO SPECIAL G/L DEFINE IN ACCT TYPE K IN SPECIAL G/L IND A RECON ACCOUNT.  I try to troubleshoot CONFIGURATION in FS00 for Special G/L,  Review vendor K

  • A Question About The Compressor 4.0.7 Update.

    On this page: http://support.apple.com/kb/HT4590 it says that in the latest version of compressor (4.0.7) they have "Removes 1 GB file size limit for uploads to Vimeo" what exactly does this mean?

  • Java Studio Creator 2

    I have downloaded the Creator2 binary for both Solaris and Linux, but I have not been able to get into the web site to provide feedback. Can someone help me.

  • Action Link

    Experts, I am using an Action Link for navigating from Analytics to Siebel record. I dont know why the link for drilling down is not appearing.Static value is appearing.How to get the link so that I can drilldown to Siebel record. thx, parag

  • Splitting DMG file onto multiple disks

    So, I've created a ~45GB DMG file to backup some data, and I want to be able to burn it to DVD's. I've read a little about splitting DMGs using the hdiutil but I'm not familiar enough with the terminal to do it that way. Does anyone know of an easy w