A Problem with TextFields?

I have a form that edits a table
It is fine when you use the form to create a record for the table, however when you edit an existing record the textfields only let you edit the text if you either delete some white space after the text or a few chars from the field but only the number of chars you remove? is there a way to stop this. I have recreated this form and i still get the same problem. It only seems to be this one application though?
Would apreciate some help Thanks
LT

LT,
"...the textfields only let you edit the text if you either delete some white space after the text or a few chars from the field but only the number of chars you remove? is there a way to stop this..."
I am not sure I understand what the problem is. Could you explain that a bit more in
details?
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/apex/f?p=107:7
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • Problem with TextField formatting

    I'm having a little bit of a problem with this very basic bit
    of code. The following code works fine: (I apologize for not having
    it in a format that may be more suitable)
    this.createTextField("my_text", this.getNextHighestDepth(),
    10, 70, 400, 100);
    my_text.text = "This is my TextField.";
    //my_text.embedFonts = true;
    However, for some reason, this doesn't work. I'm baffled by
    why uncommenting this simple line of code makes it not show up:
    this.createTextField("my_text", this.getNextHighestDepth(),
    10, 70, 400, 100);
    my_text.text = "This is my TextField.";
    my_text.embedFonts = true;
    Any help would be appreciated.

    My guess is that you forgot a few things to work with
    embedded fonts...
    1) Have you embedded the font you want to use inside your
    library and given it a unique id.
    2) If you did #1, try this...

  • Problems with TextField in Window (jre 1.4.2)

    Hi,
    I have a problem with the following code, which used to run o.k. on older vm's:
    <CODE>
    import java.awt.*;
    import java.awt.event.*;
    class TFTest extends Window {
         public TFTest(Frame frame) {
              super(frame);
              TextField tf = new TextField("Hello!");
              tf.setEditable(true);
              tf.requestFocus();
              add(tf);
         public static void main(String args[]) {
              System.out.println("Starting MAPP ParentGui...");
              Frame frame = new Frame("TFTest");
              TFTest mainFrame = new TFTest(frame);
              mainFrame.setSize(240, 320);
              mainFrame.setVisible(true);
    </code>
    The TextField doesn't seem to become editable whatever I change....
    gr,
    Peter

    Two problems:
    1. You must make parent Frame visible to make child Window focusable(see Javadoc for Window.isFocusable)
    2. You request focus on the component before adding it to the top-level. Make sure you first add component, then request focus on it.

  • Problem with Textfield autocomplete -- only uses the INSTR function

    Hi dev team,
    I use the new APEX "textfield autocomplete" item type and got a really damn problem with it.
    I have a table with an index on the same column which I want to search with the autocomplete field.
    Index:
    CREATE BITMAP INDEX TEST.GEO_DATA_IDX1 ON TEST.GEO_DATA (postcode)
    NOLOGGING TABLESPACE TS_INDEX;Select which is automatically generated by APEX 4:
    SELECT   a.*
      FROM   (  SELECT   DISTINCT postcode AS RV
                  FROM   TEST.GEO_DATA
                 WHERE   country_id = :P1_COUNTRY
              ORDER BY   1) a
    WHERE   INSTR ("RV", :p$_search_string) > 0 AND ROWNUM <= :p$_max_rows;
    -- plan
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 4,308  Bytes: 45,31  Cardinality: 1,97            
         2 SORT UNIQUE  Cost: 4,307  Bytes: 45,31  Cardinality: 1,97       
              1 TABLE ACCESS FULL TABLE #TABLE# Cost: 4,306  Bytes: 47,311  Cardinality: 2,057  In APEX 3 I used the addon from Tyler Muth with my own Select:
    SELECT   DISTINCT
                postcode AS DV,
                postcode AS RV
         FROM   TEST.GEO_DATA
         WHERE   country_id = L_COUNTRY
         AND    postcode like l_search||'%'
         ORDER BY 1
    -- Plan
    SELECT STATEMENT  ALL_ROWSCost: 840  Bytes: 152,867  Cardinality: 13,897                                
         8 SORT ORDER BY  Cost: 840  Bytes: 152,867  Cardinality: 13,897                           
              7 HASH UNIQUE  Cost: 838  Bytes: 152,867  Cardinality: 13,897                      
                   6 VIEW VIEW index$_join$_001 Cost: 836  Bytes: 232,111  Cardinality: 21,101                 
                        5 HASH JOIN            
                             2 BITMAP CONVERSION TO ROWIDS  Cost: 31  Bytes: 232,111  Cardinality: 21,101       
                                  1 BITMAP INDEX RANGE SCAN INDEX (BITMAP) #INDEX#
                             4 BITMAP CONVERSION TO ROWIDS  Cost: 45  Bytes: 232,111  Cardinality: 21,101       
                                  3 BITMAP INDEX SINGLE VALUE INDEX (BITMAP) #INDEX#Is there a chance getting my INDEX used by the new APEX item? I guess not. But I still want to ask before I rebuild everything. :)
    Best regards,
    Tobias

    Hi Tobias,
    I assume you are currently using "Contains & Case Sensitive" for the "Search" attribute. Have you already tried out "Exact & Case Sensitive"? Because that will internally use the LIKE operator as your original query does and because the % is at the end it should enable the use of an index. But it might still not work, because the ORDER BY might be executed at a different time than in your original example, but it's worth a try.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • GUI problem with textfields, reading in text from a textpad

    Alright well, here is my problem. I am having trouble with aliging the textfields to how I want it but I can't get it to come out how I want it. First, I am trying to figure out how to have the some text appear right above a textfield. Example:
    File Name
    I can't get it appear that way, the text appears side to side with the textfield. And the other problem is how can I made the size of textfield to how I want it. I was reading that you have to assign a specfic number in the text field.
    This is the code I have so far:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class IP_Header extends JApplet
    private JTextField lookUp, showInfo;
    private JButton analyze;
    private JLabel msg;
    public void init()
    JPanel p1 = new JPanel();
    p1.setLayout(new GridLayout(3,2));
    p1.add(new JLabel("File Name"));
    p1.add(lookUp = new JTextField());
    p1.add(analyze = new JButton("Analyze"));
    p1.add(showInfo = new JTextField());
    msg = new JLabel(" ");
    Container cp = getContentPane();
    cp.setLayout(new BorderLayout());
    cp.add(p1, BorderLayout.NORTH);
    With this what I am tryin to do is as follows:
    File Name
    * "TextField" * *
    **************** * This is a textfield where I am just going to
    * have some text appear in it
    * "Button" * *
    Thank you for your help. I hope you can help me. I haven't done java for a quite a while. Thanks again

    Thanks for help ... really helpful and understanding. I am trying to read a file from the computer which has some numbers in it and I want those numbers to be shown on the textfields individually. The numbers are in a notepad file and they are .... 4, 5, 200, 780, 1, 0, 0, 12, 6, 0, 129, 24, 21, 44, 133, 62, 159, 7. I got the program to compile and everything by adding the code that I believe should work . But whenever I put the file name in and press the button analyze ... it gives me a error saying "Exception: access denied (java.io.FilePermission c:\TCP read) .. can't quite get it ...here the code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    public class IP_Header extends JApplet
        private JTextField lookUp, showInfo;
        private JButton analyze;
        private JLabel msg;
        public void init()
            GridBagLayout gridbag = new GridBagLayout();
            JPanel p1 = new JPanel(gridbag);
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridwidth = gbc.REMAINDER;     // one component per row
            gbc.insets = new Insets(0,20,5,0); // spacer [top, left, bottom, right]
            gbc.weightx = 1.0;                 // allows horizontal placement
            gbc.anchor = gbc.WEST;             // align left
            p1.add(new JLabel("File Name"), gbc);
            p1.add(lookUp = new JTextField(16), gbc);
            p1.add(analyze = new JButton("Analyze"), gbc);
            p1.add(showInfo = new JTextField(16), gbc);
            // center section of content pane border layout
            // First Panel - 2 rows, 4 columns
            JPanel p2 = new JPanel(gridbag);
            gbc.insets = new Insets(2,0,0,0);
            gbc.anchor = gbc.CENTER;
            JTextField verText = new JTextField(8);
            JTextField HLENText = new JTextField(8);
            JTextField ServiceType = new JTextField(8);
            JTextField TotalText = new JTextField(8);
            gbc.gridwidth = 1;
            p2.add(new JLabel("VER"), gbc);
            p2.add(new JLabel("HLEN"), gbc);
            p2.add(new JLabel("Service Type"), gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p2.add(new JLabel("Total Length"), gbc);
            gbc.gridwidth = 1;
            p2.add(verText, gbc);
            p2.add(HLENText, gbc);
            p2.add(ServiceType, gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p2.add(TotalText, gbc);
            // Second Panel - 4 rows, 3 columns
            JPanel p3 = new JPanel(gridbag);
            JTextField fragText = new JTextField(8);
            JTextField flags = new JTextField(8);
            JTextField fragOffText = new JTextField(8);
            gbc.insets = new Insets(5,0,0,0);
            gbc.gridwidth = 1;
            p3.add(new JLabel("Fragmentation ID"), gbc);
            p3.add(new JLabel("Flags"), gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p3.add(new JLabel("Fragmentation Offset"), gbc);
            gbc.insets = new Insets(2,0,0,0);
            gbc.gridwidth = 1;
            p3.add(fragText, gbc);
            p3.add(flags, gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p3.add(fragOffText, gbc);
            JTextField ttlText = new JTextField(8);
            JTextField protocolText = new JTextField(8);
            JTextField headText = new JTextField(8);
            gbc.insets = new Insets(5,0,0,0);
            gbc.gridwidth = 1;
            p3.add(new JLabel("TTL"), gbc);
            p3.add(new JLabel("Protocol"), gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p3.add(new JLabel("HeaderChecksum"), gbc);
            gbc.insets = new Insets(2,0,0,0);
            gbc.gridwidth = 1;
            p3.add(ttlText, gbc);
            p3.add(protocolText, gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p3.add(headText, gbc);
            // Third Panel - 4 rows, 4 columns
            JPanel p4 = new JPanel(gridbag);
            JTextField sIP1text = new JTextField(4);
            JTextField sIP2text = new JTextField(4);
            JTextField sIP3text = new JTextField(4);
            JTextField sIP4text = new JTextField(4);
            gbc.insets = new Insets(5,0,0,0);
            gbc.gridwidth = 1;
            p4.add(new JLabel("SourceIP"), gbc);
            p4.add(new JLabel(" "), gbc);
            p4.add(new JLabel(" "), gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p4.add(new JLabel(" "), gbc);
            gbc.insets = new Insets(2,0,0,0);
            gbc.gridwidth = 1;
            p4.add(sIP1text, gbc);
            p4.add(sIP2text, gbc);
            p4.add(sIP3text, gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p4.add(sIP4text, gbc);
            JTextField dIP1text = new JTextField(4);
            JTextField dIP2text = new JTextField(4);
            JTextField dIP3text = new JTextField(4);
            JTextField dIP4text = new JTextField(4);
            gbc.insets = new Insets(5,0,0,0);
            gbc.gridwidth = 1;
            p4.add(new JLabel("Destination IP"), gbc);
            p4.add(new JLabel(" "), gbc);
            p4.add(new JLabel(" "), gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p4.add(new JLabel(" "), gbc);
            gbc.insets = new Insets(2,0,0,0);
            gbc.gridwidth = 1;
            p4.add(dIP1text, gbc);
            p4.add(dIP2text, gbc);
            p4.add(dIP3text, gbc);
            gbc.gridwidth = gbc.REMAINDER;
            p4.add(dIP4text, gbc);
            JPanel panel = new JPanel(gridbag);
            gbc.fill = gbc.HORIZONTAL;
            gbc.insets = new Insets(0,5,0,5);
            panel.add(p2, gbc);
            panel.add(p3, gbc);
            panel.add(p4, gbc);
            msg = new JLabel(" ");
            Container cp = getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(p1, "North");
            cp.add(panel);
            setSize(450,375);
             analyze.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        String array[] = new String[18];
                        String blankString = new String();
                        String tempString = lookUp.getText();
                        showInfo.setText(array[0]);
                        try
                             FileReader fr = new FileReader(tempString);
                             BufferedReader br = new BufferedReader(fr);
                             String line = br.readLine();
                             StringTokenizer st = new StringTokenizer (line,",");
                             for (int i=0; i<=18; i++)
                                  array[i] = st.nextToken().trim();
                        catch(Exception f)
                             System.out.println("Exception: " + f.getMessage());
    }

  • [FLASH MX] problem with textfield et numeric variable

    hi everyone
    I want to make an automatic slideshow
    i ve an editable textfield ("tempo") in wich the user write
    numbers ... for
    me this number should be a variable the user can change
    This value will allow me to deal as a tempo that will load
    picture each
    second or 2 sec ...
    here is the function :
    _global.tempo = Number(tempo.text);
    filename = ["img01.jpg", "img02.jpg", "img03.jpg",
    "img04.jpg",
    "img05.jpg"];
    path = "images/";
    clearInterval(displayI);
    function displayF() {
    var k = Math.floor(Math.random()*filename.length);
    while (k == prevIndex) {
    k = Math.floor(Math.random()*filename.length);
    loadMovie(path+filename[k], my_mc);
    prevIndex = k;
    displayF();
    //button action:
    BTrandom.onPress = function() {
    displayI = setInterval(displayF, tempo);
    updateAfterEvent();
    trace(tempo);
    the textfield is of course editable.
    i ve put a trace on thetempo value the problem is that when i
    clic on the
    BTrandom button
    the value doesn't change, it keeps the original one
    i would be realy please if someone help me to find why it
    doesn't work as i
    would ...
    thanks a lot

    Have a look at:
    http://xtrema.rtr.gr/cDown/files/xTextMem_convertToAnsi.rar
    This includes both a new unicode rtf member, and a method to
    convert unicode
    text to ansi text that director can display.
    The text member can display any language and also supports
    embedding images.
    The conversion will not work if the text includes multi-byte
    characters -
    you'll be prompted if such characters exist.
    So, try if it works for your docs, and then we'll see what we
    can do so that
    > ..which means LOT of pain..
    does not happen.
    P.S. Hyperlink translation was not enabled in the Xtra
    version used by the
    app.
    "Blade75" <[email protected]> wrote in
    message
    news:f9c14e$1rs$[email protected]..
    > Hi everybody!
    > I have some applications made with Director MX 2004, and
    I have to convert
    > the
    > writings to polish language. I have the translations in
    a word .doc file,
    > and I
    > found out that when I paste the text into Director, the
    accented and
    > special
    > polish letters don't display in Director correctly. It
    shows the empty
    > square
    > or strange wrong characters, as it could not map the
    font correctly. I
    > tried to
    > embed the font, but it still does not work. At first I
    thought I messed up
    > with
    > the font, as the font was manually edited to add the
    special letters (but
    > the
    > font does work in every other application... photoshop,
    flash, word et
    > cetera).
    > But the problem remains even if I use/embed a "standard"
    window font like
    > Times New Roman, Arial and so on. It seems that Director
    is refusing to
    > use
    > correctly the font, even if I embed it entirely as full
    set.
    >
    > Now, is there a solution to this? Is it "normal"? Or
    have I to resign
    > myself
    > and convert all the text to images...which means LOT of
    pain :(
    >
    > Thank you in advance,
    > Bl@de
    >

  • Problem with textfields

    I add in stage four textfields naming letter1, letter2 ...
    I want with a button click to add text in someone of this textfields.
    This is the code.
    for (var i:Number = 0; i<4; i++) {
    var txtFld:TextField = new TextField();
    txtFld.name = "letter"+i
    addChild(txtFld)
    myBtn.addEventListener(MouseEvent.CLICK, PutLetter);
    function PutLetter(ev) {
    letter1.text = "Billy"
    Then in the output shows:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at Untitled_fla::MainTimeline/PutLetter()
    I can't manage this...
    Please help!!!

    If you are familiar with AS2, then you need to understand that in AS3 the name assigned to a dynamically created object, such as your textfield(s) is a mere string property... it is no longer a direct targeting element of an object.  What you need to do is utilize the getChildByName() method to use that name...
    myBtn.addEventListener(MouseEvent.CLICK, PutLetter);
    function PutLetter(ev:MouseEvent) {
        TextField(this.getChildByName("letter1")).text = "Billy";
    If you manually place the object on the stage in the editor, then the instance name you assign to it in the properties panel can be used to target it.

  • Major problem with textfields set to TLF

    Looks like the garbage collector is not removing movieclips that have textfields set to TLF. I'm using Flash Builder's profile inspector and TLF brings in a bunch of objects and prevents the clip from being removed by the garbage collector (including all the objects that TLF put in memory).
    How could Adobe release CS5 with such a crappy implementation of text? If there is no solution I will have to avoid using TLF text for all my projects. I strongly suggest everyone avoid TLF.

    The solution is to use dynamic TLF textfields. Create them using actionscript.
    What I did in my project was use classic textfields just for layout purposes and then remove them with actionscript and replace them with a TLF textfield. In the destroy function for your class make sure you remove the TLF from the stage and set it's variable to null.
    Everywhere else in project where I didn't need TLF i switched back to Classic text fields.
    I needed the TLF for emoticons in a chat application. TLF will throw some items in memory when it loads the swz file.
    If you don't need TLF avoid it.

  • Problem with append += text in Text Field

    Hi guys
    i have a problem with append text.
    I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc];
    Then i have one String and one Text Field.
    Using for loop im getting right results. But when im running script again then im getting  same text again.
    F.ex.
    First time:
    City name: Name 1
    City name: Name 2
    Second time:
    City name: Name 1
    City name: Name 2
    City name: Name 1
    City name: Name 2
    I have tried to make TextField to and String to Null and delete it, but it's appearing again.. :/
    How to avoid this?
    Here is script:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    _CityAreaTF1 = new TextField();
      _CityAreaTF1.border = true;
      _CityAreaTF1.wordWrap = true;
      _CityAreaTF1.multiline = true;
      _CityAreaTF1.selectable = false;
      _CityAreaTF1.antiAliasType = AntiAliasType.ADVANCED;
      _CityAreaTF1.name = "CityAreaTF1";
      _CityAreaTF1.embedFonts = true;
      _CityAreaTF1.htmlText = _CityAreaString1.toUpperCase();

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Problem with formatting text in textobjects with right aligned tabulators

    Post Author: Jens Kluesener
    CA Forum: General
    HiI want to print out some values in a line. So I put a Textobject in the Report with some right aligned tabulators (left aligned tabulators working fine). Then I insert a formula. In this formula i do this:"1"chr(9)"2"chr(9)"3"chr(9)"4"chr(9)"5"chr(9)"6"chr(9)"7"Look:            Many ThanksJens

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Problem with expanding textfield in Adobe LiveCycle Designer

    I've got an urgent problem with Adobe LiveCycle Designer and I really could use some help. The problem is that I'm trying to get my textfield expandable, but whatever I try, it's not working. What I'm trying to get done is that you can fill in a textfield, and when there is more text than the size of the field, the textfield expands to make the text fit in the field.
    I tried a whole lot of things:
    placing the textfield in a subform
    expand to fit (height)
    allow multiple lines
    allow page breaks
    flowed/positioned
    etc.
    The strange thing is, that no matter what I try to adjust, I can't change anything in the pagination tab. Maybe that is the problem, but I don't know what to do, to change that.
    In the examples of Adobe itself (Purchase Form) is an example of a textfield that sort of behaves as I want it to, BUT the problem is that that textfield in the subform has to be triggered to appear by a button (add comments) and that is what I don't want. I want the textfield to be visible from the beginning. But in that example you CAN see the pagination tab and make changes in it.
    I searched a lot in the Adobe Helpfiles of Designer, and I even bought and read/studied the book 'Creating Dynamic Forms with Adobe LiveCycle Designer', but still I'm not able to get this done.
    Is there anyone who can help me?
    Thanks in advance,
    Sterre

    I am creating my first .pdf with no training. I first converted a word doc of our form into a .pdf. Modified everything and thought I was the "bomb" for figuring it out. Then I tried to use the form and where I had "allowed multiple lines" I realized that it would allow that but not display it or print it except for what was showing.
    In researching for a solution, this site said to use "expand to fit". After much frustration I realized that this feature is only available if you created the form from scratch in adobe.
    I have figured out, somewhat, how to create the form and get the field to move with the text but I need the entire form to adjust to the input. Can't have one specific field expand into the rest of the form.
    I did some more research on this site, and it looks like the solution has something to do with 'subforms'. No idea what to do.
    If anyone knows if there is a way to do this with a converted doc (since I already have that completed) I would GREATLY appreciate it. If it isn't possible, could someone walk me through how to do it or provide a reference for a "barney style" walk through?
    Appreciate ANY assistance you can provide. THANKS! Guess I need to sign up for an Adobe Pro class. BTW I'm working on LiveCyle 8.0

  • HTML Textfield Problem with Image Positions/Image Tag img

    I am using :
    Flash Builder Burito - Flex Hero SDK -  Air 2.5 - Flash Player 10.1
    Hi,
    i have a problem with the normal Textfield.I'm loading html text into it and apply an css stylesheet on it. Everything works fine, but if there is an <img> in the html code, the image is displayed at the wrong position (top left).
    It looks like the Problem is only in Air Applications. I tried the exact same code in an normal actionscript project and tested it in the broweser. Here the images are at the right position.
    Does anybody else has this problem in Air or knows a solution to this?
    Thanks. Laurid
    btw: I tried it on Windows 7 and Android with the same problem.

    Okay, I think I found the solution myself:
    http://www.kirupa.com/forum/showthread.php?t=322233
    For AIR content in the application security sandbox, AIR ignores img  tags in HTML content in ActionScript TextField objects. This is to  prevent possible phishing attacks,
    This does not make any sense to me. Can somebody please explain it to me? I can load images with the loader-class and combine it with my html text. The only thing which does not work is that the text is wrapping aroung the images. So why does this prevent phishing attacks?
    For me this doesn't make sense at all. It's just annoying that you develop an application in Flash and that it's not working the same way in Adobe Air. Now I have to find a complicated work-around myself. Or does anybody know how I can easily wrap text around images?
    Thanks. Laurid

  • Problems with the selection of text or objects

    dear fireworks community!
    unfortunately i have problems with my running version fireworks (CS6) and i can't find any solution or even get help via the customer support.
    i can't switch between objects with a click, when i've choosen one already. i also can't cancel the entire selection. the only way (to select a new item) is to click on an empty space, hold it and pull the selection over a new item.
    another thing is that i cant select a textfield with a doubleclick or switch beteween choosen tools within the usage of a shortcut …
    what i already tried:
    updating, deinstalling, re-storing preferences, "cleaning" the libraries, installing (this entire scenario for at least three times)
    i hope someone of you can help me!
    thanks in advance!

    incredible!
    thank you so much!

  • Problem with focus and selecting text in jtextfield

    I have problem with jtexfield. I know that solution will be very simple but I can't figure it out.
    This is simplified version of situation:
    I have a jframe, jtextfield and jbutton. User can put numbers (0-10000) separated with commas to textfield and save those numbers by pressing jbutton.
    When jbutton is pressed I have a validator which checks that jtextfield contains only numbers and commas. If validator sees that there are invalid characters, a messagebox is launched which tells to user whats wrong.
    Now comes the tricky part.
    When user presses ok from messagebox, jtextfield should select the character which validator said was invalid so that user can replace it by pressing a number or comma.
    I have the invalid character, but how can you get the focus to jtextfield and select only the character which was invalid?
    I tried requestFocus(), but it selected whole text in jtextfield and after that command I couldn't set selected text. I tried with commands setSelectionStart(int), setSelectionEnd(int) and select(int,int).
    Then I tried to use Caret and select text with that. It selected the character I wanted, but the focus wasn't really there because it didn't have keyFocus (or something like that).
    Is there a simple way of doing this?

    textField.requestFocusInWindow();
    textField.select(...);The above should work, although read the API on the select(...) method for the newer recommended approach on how to do selection.
    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",
    see http://homepage1.nifty.com/algafield/sscce.html,
    that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • Problem with writing and reading using serialization

    I am having a problem with writing and reading an object that has another object in it. The purpose of the class is to write a order that has multiple items in it. And there will be several orders. This is for an IB project, where one of the requirements is to utilize a hierarchical composite data structure. That is, it is "one that contains more than one element and at least one of the elements is a composite data structure. Examples are, an array or linked list of records, a record that has one field that is another record, or an array". The code is shown below:
    The error produced is
    java.lang.NullPointerException
         at SamsonRubberIndustries.CustomerOrderDetails.createCustOrdDetailsScreen(CustomerOrderDetails.java:150)
         at SamsonRubberIndustries.CustomerOrderDetails$1.run(CustomerOrderDetails.java:78)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    public class CustOrdObject implements Serializable {
         public int CustID;
         public int CustOrderID;
         public Object OrderDate;
         public InnerCustOrdObject[] innerCustOrdObj;
         public float GrandTotal;
         public int MaxItems;
         public CustOrdObject() {}
         public CustOrdObject(InnerCustOrdObject[] innerCustOrdObj,
    int CustID, int CustOrderID, Object OrderDate,
    float GrandTotal, int innerarrlength, int innerarrpos, int MaxItems) {
              this.CustID = CustID;
              this.CustOrderID = CustOrderID;
              this.OrderDate = OrderDate;
              this.GrandTotal = GrandTotal;          
              this.MaxItems = MaxItems;
              this.innerCustOrdObj = new InnerCustOrdObject[MaxItems];
         public InnerCustOrdObject[] getInnerCustOrdObj() {
              return innerCustOrdObj;
         public void setInnerCustOrdObj(InnerCustOrdObject[] innerCustOrdObj) {
              this.innerCustOrdObj = innerCustOrdObj;
         public int getCustID() {
              return CustID;
         public void setCustID(int custID) {
              CustID = custID;
         public int getCustOrderID() {
              return CustOrderID;
         public void setCustOrderID(int custOrderID) {
              CustOrderID = custOrderID;
         public Object getOrderDate() {
              return OrderDate;
         public void setOrderDate(Object orderDate) {
              OrderDate = orderDate;
         public void setGrandTotal(float grandTotal) {
              GrandTotal = grandTotal;
         public float getGrandTotal() {
              return GrandTotal;
         public int getMaxItems() {
              return MaxItems;
         public void setMaxItems(int maxItems) {
              MaxItems = maxItems;
    public class InnerCustOrdObject implements Serializable{
         public int ItemNumber;
         public float UnitPrice;
         public int QuantityRequired;
         public float TotalPrice;
         public InnerCustOrdObject() {}
         public InnerCustOrdObject(int ItemNumber, float
    UnitPrice, int QuantityRequired, float TotalPrice){
              this.ItemNumber = ItemNumber;
              this.UnitPrice = UnitPrice;
              this.QuantityRequired = QuantityRequired;
              this.TotalPrice = TotalPrice;
         public int getItemNumber() {
              return ItemNumber;
         public void setItemNumber(int itemNumber) {
              ItemNumber = itemNumber;
         public int getQuantityRequired() {
              return QuantityRequired;
         public void setQuantityRequired(int quantityRequired) {
              QuantityRequired = quantityRequired;
         public float getTotalPrice() {
              return TotalPrice;
         public void setTotalPrice(float totalPrice) {
              TotalPrice = totalPrice;
         public float getUnitPrice() {
              return UnitPrice;
         public void setUnitPrice(float unitPrice) {
              UnitPrice = unitPrice;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.swing.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.DefaultTableModel;
    public class CustomerOrderDetails extends CommonFeatures{
         //TODO
         private static int MAX_ORDERS = 200;
         private static int MAX_ORDERITEMS = 100;
         private static int MaxRecord;
         private static int CurrentRecord = 1;
         private static int currentItem;
         private static int MaxItems;
         private static boolean FileExists, recFileExists;
         private static CustOrdObject[] orderDetails = new CustOrdObject[MAX_ORDERS];
         private static InnerCustOrdObject[] innerCustOrdObj = new InnerCustOrdObject[MAX_ORDERITEMS];     
         private static File OrderDetailsFile = new File("CustOrdDetails.dat");
         private static File OrdRecordNumStore = new File("OrdRecordNumStore.txt");
         private static PrintWriter writeFile;
         private static BufferedReader readFile;
         private static ObjectOutputStream objOut;
         private static ObjectInputStream objIn;
         //Set format for date
         SimpleDateFormat simpleDF = new SimpleDateFormat("dd MM yyyy");
         //--<BEGINNING>--Declaring Interface Variables------------------------------------------//
         private JPanel innertoppanel, innercenterpanel, innerbottompanel, innerrightpanel, innerleftpanel;
         private JLabel CustIDLbl, CustOrderIDLbl, OrderedDateLbl, GrandTotLbl, ItemNumberLbl,UnitPriceLbl, QuantityReqLbl, TotPriceLbl;
         private JTextField CustIDTxt, CustOrderIDTxt, OrderedDateTxt, GrandTotTxt, ItemNumberTxt, UnitPriceTxt, QuantityReqTxt, TotPriceTxt;
         private JButton addrecordbtn, savebtn, externalprevbtn, externalnextbtn, internalprevbtn, internalnextbtn, gotorecordbtn, additemreqbtn;
         //--<END>--Declaring Interface Variables------------------------------------------------//
         public static void main(String[] args) {
              final CustomerOrderDetails COD = new CustomerOrderDetails();
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        try {
                             UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                             COD.createCustOrdDetailsScreen();
                        } catch (Exception eb) {
                             eb.printStackTrace();
         //--<BEGINNING>--Creating CustomerOrderDetails Screen---------------------------------------//
         public JFrame createCustOrdDetailsScreen() {
              createDefaultFrame();
              mainframe.setSize(800,500);
              createContainerPanel();
              containerpanel.add(createCustOrdDetailsTitle(), BorderLayout.NORTH);
              containerpanel.add(createCustOrdDetailsMainPanel(), BorderLayout.CENTER);
              //containerpanel.add(createCustOrdDetailsLeftNavButtons(), BorderLayout.WEST);
              //containerpanel.add(createCustOrdDetailsRightNavButtons(), BorderLayout.EAST);
              containerpanel.add(createCustOrdDetailsButtons(), BorderLayout.SOUTH);
              mainframe.setContentPane(containerpanel);
              mainframe.setLocationRelativeTo(null);
              mainframe.setVisible(true);
              //--<BEGINNING>--Checks to see whether CRecordNumberStore file exists-------------------------------//
              if (OrdRecordNumStore.exists() == true) {
                   recFileExists = true;
              }else {
                   recFileExists = false;
              if (recFileExists == true) {
                   MaxRecord = readRecordNumber();
                   CurrentRecord = MaxRecord;
                   //readOrder();
                   //readInnerOrderRecord(CurrentRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              }else{
                   MaxRecord = 1;
                   writeRecordNumber(MaxRecord);
                   CustOrderIDTxt.setText(""+MaxRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              //--<END>--Checks to see whether CRecordNumberStore file exists--------------------------------------//
              if(readOrder() != null){
                   orderDetails = (CustOrdObject[]) readOrder();
                 innerCustOrdObj = orderDetails[CurrentRecord].getInnerCustOrdObj();
                   MaxItems = orderDetails[CurrentRecord].getMaxItems();
                   if(CurrentRecord > 1 && CurrentRecord < MaxRecord){
                        externalnextbtn.setEnabled(true);
                        externalprevbtn.setEnabled(true);
                   if(CurrentRecord >= MaxRecord){
                        externalnextbtn.setEnabled(false);
                   getFieldText(CurrentRecord-1);
              }else{
                   orderDetails[CurrentRecord] = new CustOrdObject();
                   currentItem = 1;
              return mainframe;
         //--<END>--Creating CustomerOrderDetails Screen---------------------------------------------//
         public JPanel createCustOrdDetailsTitle(){
              createTitlePanel();
              titlepanel.setBackground(TxtfontColor);
              label.setText("- Customer Order Details -");
              labelpanel.setBackground(TxtfontColor);
              label.setForeground(Color.white);
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor) ;
              buttonpanel.add(createReturnToMainMenuButton());
              titlepanel.add(labelpanel, BorderLayout.WEST);
              titlepanel.add(buttonpanel, BorderLayout.EAST);
              return titlepanel;
         public JPanel createCustOrdDetailsMainPanel(){
              createmainpanel();
              mainpanel.setBackground(TxtfontColor);
              mainpanel.setLayout(new BorderLayout());          
              mainpanel.setBorder(BorderFactory.createTitledBorder(""));
              mainpanel.add(createInnerTopPanel(), BorderLayout.NORTH);
              mainpanel.add(createInnerCenterPanel(), BorderLayout.CENTER);
              mainpanel.add(createInnerBottomPanel(), BorderLayout.SOUTH);
              mainpanel.add(createInnerRightPanel(), BorderLayout.EAST);
              mainpanel.add(createInnerLeftPanel(), BorderLayout.WEST);
              return mainpanel;
         public JPanel createInnerTopPanel(){
              innertoppanel = new JPanel(new GridBagLayout());
              innertoppanel.setBackground(TxtfontColor);
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              CustIDLbl = new JLabel("Customer ID");
              CustIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustIDLbl.setFont(font);
              CustIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innertoppanel.add(CustIDLbl, GBC);     
              CustIDTxt = new JTextField(20);
              CustIDTxt.setEditable(true);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innertoppanel.add(CustIDTxt, GBC);
              GBC.gridx = 3;
              GBC.gridy = 1;
              innertoppanel.add(Box.createHorizontalStrut(220), GBC);
              OrderedDateLbl = new JLabel("Order Date");
              OrderedDateLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              OrderedDateLbl.setFont(font);
              OrderedDateLbl.setForeground(LblfontColor);
              GBC.gridx = 4;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateLbl, GBC);     
              //Get today's date
              Date todaydate = new Date();
              OrderedDateTxt = new JTextField(simpleDF.format(todaydate), 20);
              OrderedDateTxt.setHorizontalAlignment(JTextField.CENTER);
              OrderedDateTxt.setEditable(false);
              GBC.gridx = 5;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateTxt, GBC);
              CustOrderIDLbl = new JLabel("Customer Order ID");
              CustOrderIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustOrderIDLbl.setFont(font);
              CustOrderIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDLbl, GBC);
              CustOrderIDTxt = new JTextField(20);
              CustOrderIDTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDTxt, GBC);
              return innertoppanel;
         public JPanel createInnerCenterPanel(){
              innercenterpanel = new JPanel(new GridBagLayout());
              innercenterpanel.setBackground(TxtfontColor);
              innercenterpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              ItemNumberLbl = new JLabel("Item Number");
              ItemNumberLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              ItemNumberLbl.setFont(font);
              ItemNumberLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberLbl, GBC);     
              ItemNumberTxt = new JTextField(20);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberTxt, GBC);
              UnitPriceLbl = new JLabel("Unit Price");
              UnitPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              UnitPriceLbl.setFont(font);
              UnitPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceLbl, GBC);     
              UnitPriceTxt = new JTextField(20);
              //UnitPriceTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceTxt, GBC);
              QuantityReqLbl = new JLabel("Quantity Required");
              QuantityReqLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              QuantityReqLbl.setFont(font);
              QuantityReqLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqLbl, GBC);     
              QuantityReqTxt = new JTextField(20);
              //QuantityReqTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqTxt, GBC);
              TotPriceLbl = new JLabel("Total Price");
              TotPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              TotPriceLbl.setFont(font);
              TotPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceLbl, GBC);     
              TotPriceTxt = new JTextField(20);
              //TotPriceTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceTxt, GBC);
              return innercenterpanel;
         public JPanel createInnerBottomPanel(){
              innerbottompanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
              innerbottompanel.setBackground(TxtfontColor);
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              GrandTotLbl = new JLabel("Grand Total");
              GrandTotLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              GrandTotLbl.setFont(font);
              GrandTotLbl.setForeground(LblfontColor);
              innerbottompanel.add(GrandTotLbl);
              innerbottompanel.add(Box.createHorizontalStrut(30));
              GrandTotTxt = new JTextField(20);
              innerbottompanel.add(GrandTotTxt);
              return innerbottompanel;
         public JPanel createInnerRightPanel(){
              innerrightpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerrightpanel.setBackground(TxtfontColor);
              innerrightpanel.setLayout(new BoxLayout(navrightpanel, BoxLayout.Y_AXIS));
              innerrightpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerrightpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalnextbtn = new JButton(createNextButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        //getInnerFieldText(currentItem);
                        internalprevbtn.setEnabled(true);
                        if(currentItem < MaxItems){
                             ++CurrentRecord;
                             //readOrder();
                             //readInnerOrderRecord(CurrentRecord);
                             setInnerFieldText(currentItem);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
                        if(currentItem == MaxItems){
                             internalnextbtn.setEnabled(false);
              innerrightpanel.add(internalnextbtn, GBC);
              return innerrightpanel;
         public JPanel createInnerLeftPanel(){
              innerleftpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerleftpanel.setBackground(TxtfontColor);
              innerleftpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerleftpanel.setForeground(Color.BLACK);
              innerleftpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalprevbtn = new JButton(createPreviousButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        //getInnerFieldText(currentItem);
                        internalnextbtn.setEnabled(true);
                        if(currentItem == 1){
                             internalprevbtn.setEnabled(false);
                        if(currentItem > 0){
                             --currentItem;
                             //readOrder();
                             setInnerFieldText(currentItem);
              innerleftpanel.add(internalprevbtn, GBC);
              return innerleftpanel;
         public JPanel createCustOrdDetailsButtons(){
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor);
              externalprevbtn = new JButton(createPreviousButtonIcon());
              externalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalnextbtn.setEnabled(true);
                        if(CurrentRecord == 1){
                             externalprevbtn.setEnabled(false);
                        if(CurrentRecord > 0){
                             --CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
              buttonpanel.add(externalprevbtn);
              addrecordbtn = new JButton("Add Record", createAddButtonIcon());
              addrecordbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             MaxRecord = readRecordNumber();
                             MaxRecord++;
                             writeRecordNumber(MaxRecord);
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             CustIDTxt.setText("");
                             CustOrderIDTxt.setText(""+MaxRecord);
                             //Get today's date
                             Date todaydate = new Date();
                             OrderedDateTxt.setText(""+simpleDF.format(todaydate));
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             GrandTotTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             externalnextbtn.setEnabled(false);
                             externalprevbtn.setEnabled(true);
                             System.out.println(MaxRecord);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(addrecordbtn);
              savebtn = new JButton("Save Data", createSaveButtonIcon());
              savebtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        setFieldText(CurrentRecord);
                        writeOrder();
                        writeRecordNumber(MaxRecord);
                        System.out.println(CurrentRecord);
                        System.out.println(MaxRecord);
              buttonpanel.add(savebtn);
              java.net.URL imageURL_AddRowIcon = CommonFeatures.class.getResource("Icons/edit_add.png");
              ImageIcon AddRowIcon = new ImageIcon(imageURL_AddRowIcon);
              additemreqbtn = new JButton("Add Item", AddRowIcon);
              additemreqbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             //CurrentRecord = MaxRecord;
                             currentItem++;
                             setInnerFieldText(currentItem);
                             internalnextbtn.setEnabled(false);
                             internalprevbtn.setEnabled(true);
                             System.out.println(MaxRecord);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(additemreqbtn);
              externalnextbtn = new JButton(createNextButtonIcon());
              externalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalprevbtn.setEnabled(true);
                        if(CurrentRecord < MaxRecord){
                             ++CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
                        if(CurrentRecord == MaxRecord){
                             externalnextbtn.setEnabled(false);
              buttonpanel.add(externalnextbtn);
              return buttonpanel;
         //TODO
         public void setFieldText(int orderID){//TODO
              orderDetails[orderID].setCustID(Integer.parseInt(CustIDTxt.getText()));
              orderDetails[orderID].setCustOrderID(Integer.parseInt(CustOrderIDTxt.getText()));
              orderDetails[orderID].setOrderDate(OrderedDateTxt.getText());
              orderDetails[orderID].setInnerCustOrdObj(innerCustOrdObj);
              orderDetails[orderID].setMaxItems(MaxItems);
              setInnerFieldText(currentItem);
              orderDetails[orderID].setGrandTotal(Float.parseFloat(GrandTotTxt.getText()));
         public void setInnerFieldText(int currentItem){//TODO
              innerCustOrdObj[currentItem] = new InnerCustOrdObject();
              innerCustOrdObj[currentItem].setItemNumber(Integer.parseInt(ItemNumberTxt.getText()));
              innerCustOrdObj[currentItem].setUnitPrice(Float.parseFloat(UnitPriceTxt.getText()));
              innerCustOrdObj[currentItem].setQuantityRequired(Integer.parseInt(QuantityReqTxt.getText()));
              innerCustOrdObj[currentItem].setTotalPrice(Float.parseFloat(TotPriceTxt.getText()));
         public void getFieldText(int orderID){
              CustIDTxt.setText(Integer.toString(orderDetails[orderID].getCustID()));
              CustOrderIDTxt.setText(Integer.toString(orderDetails[orderID].getCustOrderID()));
              OrderedDateTxt.setText(""+orderDetails[orderID].getOrderDate());          
              currentItem = orderDetails[orderID].getMaxItems();
              System.err.println("currentItem" + currentItem);
              getInnerFieldText(currentItem);
              GrandTotTxt.setText(Float.toString(orderDetails[orderID].getGrandTotal()));
         public void getInnerFieldText(int currentItem){
              ItemNumberTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getItemNumber()));
              UnitPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getUnitPrice()));
              QuantityReqTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getQuantityRequired()));
              TotPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getTotalPrice()));
         public void writeOrder(){//TODO
              try {
                   objOut = new ObjectOutputStream(new FileOutputStream(OrderDetailsFile));
                   objOut.writeObject(orderDetails);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              } catch (IOException e) {
                   e.printStackTrace();
         public Object readOrder(){
              Object temporaryObj;
              try{
                   objIn = new ObjectInputStream(new FileInputStream(OrderDetailsFile));
                   temporaryObj = objIn.readObject();               
                   CustOrdObject[] blah = (CustOrdObject[]) temporaryObj;
                   System.out.println("Outer: "+blah[1].getCustID());
                   InnerCustOrdObject[] whee = blah[1].getInnerCustOrdObj();
                   System.out.println("Inner: "+whee[1].getItemNumber());
                   objIn.close();
                   System.out.println("Read Worky!");
                   return temporaryObj;
              }catch(Exception e){
                   e.printStackTrace();
                   System.out.println("Read No Worky!");
                   return null;
         public void writeRecordNumber(int MaxRecord){
              try{
                   objOut = new ObjectOutputStream(new FileOutputStream(OrdRecordNumStore));
                   objOut.writeObject(MaxRecord);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              }catch(Exception e){e.printStackTrace();}
         public int readRecordNumber() {
              try {
                   objIn = new ObjectInputStream(new FileInputStream(OrdRecordNumStore));
                   int temporaryObj = Integer.parseInt(objIn.readObject().toString());
                   objIn.close();
                   System.out.println("Read Number Worky!");
                   return temporaryObj;
              } catch (Exception e) {
                   e.printStackTrace();
                   System.out.println("Read Number No Worky!");
                   return -1;
    }Message was edited by:
    Kilik07
    Message was edited by:
    Kilik07

    ok i got reading to work to a certain extent... but the prob is i cnt seem to save my innerCustOrdObj proprly...when ever i look for a record using the gotorecordbtn, the outerobject, which is the orderDetails, seems to change but the innerCustOrdObj remains the same... heres the new code..
    public class CustomerOrderDetails extends CommonFeatures{
         //TODO
         private static int MAX_ORDERS = 200;
         private static int MAX_ORDERITEMS = 100;
         private static int MaxRecord;
         private static int CurrentRecord = 1;
         private static int currentItem;
         private static int MaxItems = 1;
         private static boolean FileExists, recFileExists;
         private static boolean RecordExists;
         private static CustOrdObject[] orderDetails = new CustOrdObject[MAX_ORDERS];
         private static InnerCustOrdObject[] innerCustOrdObj = new InnerCustOrdObject[MAX_ORDERITEMS];     
         private static File OrderDetailsFile = new File("CustOrdDetails.ser");
         private static File OrdRecordNumStore = new File("OrdRecordNumStore.txt");
         private static PrintWriter writeFile;
         private static BufferedReader readFile;
         private static ObjectOutputStream objOut;
         private static ObjectInputStream objIn;
         //Set format for date
         SimpleDateFormat simpleDF = new SimpleDateFormat("dd MM yyyy");
         //--<BEGINNING>--Declaring Interface Variables------------------------------------------//
         private JPanel innertoppanel, innercenterpanel, innerbottompanel, innerrightpanel, innerleftpanel;
         private JLabel CustIDLbl, CustOrderIDLbl, OrderedDateLbl, GrandTotLbl, ItemNumberLbl,UnitPriceLbl, QuantityReqLbl, TotPriceLbl;
         private JTextField CustIDTxt, CustOrderIDTxt, OrderedDateTxt, GrandTotTxt, ItemNumberTxt, UnitPriceTxt, QuantityReqTxt, TotPriceTxt;
         private JButton addrecordbtn, savebtn, externalprevbtn, externalnextbtn, internalprevbtn, internalnextbtn, gotorecordbtn, additemreqbtn;
         //--<END>--Declaring Interface Variables------------------------------------------------//
         public static void main(String[] args) {
              final CustomerOrderDetails COD = new CustomerOrderDetails();
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        try {
                             UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                             COD.createCustOrdDetailsScreen();
                        } catch (Exception eb) {
                             eb.printStackTrace();
         //--<BEGINNING>--Creating CustomerOrderDetails Screen---------------------------------------//
         public JFrame createCustOrdDetailsScreen() {
              createDefaultFrame();
              mainframe.setSize(800,500);
              createContainerPanel();
              containerpanel.add(createCustOrdDetailsTitle(), BorderLayout.NORTH);
              containerpanel.add(createCustOrdDetailsMainPanel(), BorderLayout.CENTER);
              //containerpanel.add(createCustOrdDetailsLeftNavButtons(), BorderLayout.WEST);
              //containerpanel.add(createCustOrdDetailsRightNavButtons(), BorderLayout.EAST);
              containerpanel.add(createCustOrdDetailsButtons(), BorderLayout.SOUTH);
              mainframe.setContentPane(containerpanel);
              mainframe.setLocationRelativeTo(null);
              mainframe.setVisible(true);
              //--<BEGINNING>--Checks to see whether CRecordNumberStore file exists-------------------------------//
              if (OrdRecordNumStore.exists() == true) {
                   recFileExists = true;
              }else {
                   recFileExists = false;
              if (recFileExists == true) {
                   MaxRecord = readRecordNumber();
                   CurrentRecord = MaxRecord;
                   //readOrder();
                   //readInnerOrderRecord(CurrentRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              }else{
                   MaxRecord = 1;
                   writeRecordNumber(MaxRecord);
                   CustOrderIDTxt.setText(""+MaxRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              //--<END>--Checks to see whether CRecordNumberStore file exists--------------------------------------//
              if(readOrder() != null){
                   orderDetails = (CustOrdObject[]) readOrder();
                   //CurrentRecord--;
                   //System.out.println("Current Rec Here"+CurrentRecord);
                   if(orderDetails[CurrentRecord] == null){
                        System.err.println("CustomerOrderObj 1 is null !!");
                   }else{
                        System.err.println("CustomerOrderObj 1 is  not null !!");
                   if(orderDetails[CurrentRecord].getInnerCustOrdObj() == null){
                        System.err.println("InnerCustomerOrderObj is null !!");
                   }else{
                        System.err.println("InnerCustomerOrderObj is  not null !!");
                   innerCustOrdObj = orderDetails[CurrentRecord].getInnerCustOrdObj();
                   MaxItems = orderDetails[CurrentRecord].getMaxItems();
                   if(CurrentRecord > 1 && CurrentRecord < MaxRecord){
                        externalnextbtn.setEnabled(true);
                        externalprevbtn.setEnabled(true);
                   if(CurrentRecord >= MaxRecord){
                        externalnextbtn.setEnabled(false);
                   getFieldText(CurrentRecord);
                   getInnerFieldText(MaxItems);
              }else{
                   orderDetails[CurrentRecord] = new CustOrdObject();
                   currentItem = 1;
              return mainframe;
         //--<END>--Creating CustomerOrderDetails Screen---------------------------------------------//
         public JPanel createCustOrdDetailsTitle(){
              createTitlePanel();
              titlepanel.setBackground(TxtfontColor);
              label.setText("- Customer Order Details -");
              labelpanel.setBackground(TxtfontColor);
              label.setForeground(Color.white);
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor) ;
              buttonpanel.add(createReturnToMainMenuButton());
              titlepanel.add(labelpanel, BorderLayout.WEST);
              titlepanel.add(buttonpanel, BorderLayout.EAST);
              return titlepanel;
         public JPanel createCustOrdDetailsMainPanel(){
              createmainpanel();
              mainpanel.setBackground(TxtfontColor);
              mainpanel.setLayout(new BorderLayout());          
              mainpanel.setBorder(BorderFactory.createTitledBorder(""));
              mainpanel.add(createInnerTopPanel(), BorderLayout.NORTH);
              mainpanel.add(createInnerCenterPanel(), BorderLayout.CENTER);
              mainpanel.add(createInnerBottomPanel(), BorderLayout.SOUTH);
              mainpanel.add(createInnerRightPanel(), BorderLayout.EAST);
              mainpanel.add(createInnerLeftPanel(), BorderLayout.WEST);
              return mainpanel;
         public JPanel createInnerTopPanel(){
              innertoppanel = new JPanel(new GridBagLayout());
              innertoppanel.setBackground(TxtfontColor);
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              CustIDLbl = new JLabel("Customer ID");
              CustIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustIDLbl.setFont(font);
              CustIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innertoppanel.add(CustIDLbl, GBC);     
              CustIDTxt = new JTextField(20);
              CustIDTxt.setEditable(true);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innertoppanel.add(CustIDTxt, GBC);
              GBC.gridx = 3;
              GBC.gridy = 1;
              innertoppanel.add(Box.createHorizontalStrut(220), GBC);
              OrderedDateLbl = new JLabel("Order Date");
              OrderedDateLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              OrderedDateLbl.setFont(font);
              OrderedDateLbl.setForeground(LblfontColor);
              GBC.gridx = 4;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateLbl, GBC);     
              //Get today's date
              Date todaydate = new Date();
              OrderedDateTxt = new JTextField(simpleDF.format(todaydate), 20);
              OrderedDateTxt.setHorizontalAlignment(JTextField.CENTER);
              OrderedDateTxt.setEditable(false);
              GBC.gridx = 5;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateTxt, GBC);
              CustOrderIDLbl = new JLabel("Customer Order ID");
              CustOrderIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustOrderIDLbl.setFont(font);
              CustOrderIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDLbl, GBC);
              CustOrderIDTxt = new JTextField(20);
              //CustOrderIDTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDTxt, GBC);
              return innertoppanel;
         public JPanel createInnerCenterPanel(){
              innercenterpanel = new JPanel(new GridBagLayout());
              innercenterpanel.setBackground(TxtfontColor);
              innercenterpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              ItemNumberLbl = new JLabel("Item Number");
              ItemNumberLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              ItemNumberLbl.setFont(font);
              ItemNumberLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberLbl, GBC);     
              ItemNumberTxt = new JTextField(20);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberTxt, GBC);
              UnitPriceLbl = new JLabel("Unit Price");
              UnitPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              UnitPriceLbl.setFont(font);
              UnitPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceLbl, GBC);     
              UnitPriceTxt = new JTextField(20);
              //UnitPriceTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceTxt, GBC);
              QuantityReqLbl = new JLabel("Quantity Required");
              QuantityReqLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              QuantityReqLbl.setFont(font);
              QuantityReqLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqLbl, GBC);     
              QuantityReqTxt = new JTextField(20);
              //QuantityReqTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqTxt, GBC);
              TotPriceLbl = new JLabel("Total Price");
              TotPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              TotPriceLbl.setFont(font);
              TotPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceLbl, GBC);     
              TotPriceTxt = new JTextField(20);
              TotPriceTxt.setEditable(false);
              TotPriceTxt.addFocusListener(new FocusAdapter(){
                   public void focusGained(FocusEvent evt){
                        TotPriceTxt.setText(""+Integer.parseInt(UnitPriceTxt.getText())*Integer.parseInt(QuantityReqTxt.getText()));
              GBC.gridx = 2;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceTxt, GBC);
              return innercenterpanel;
         public JPanel createInnerBottomPanel(){
              innerbottompanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
              innerbottompanel.setBackground(TxtfontColor);
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              GrandTotLbl = new JLabel("Grand Total");
              GrandTotLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              GrandTotLbl.setFont(font);
              GrandTotLbl.setForeground(LblfontColor);
              innerbottompanel.add(GrandTotLbl);
              innerbottompanel.add(Box.createHorizontalStrut(30));
              GrandTotTxt = new JTextField(20);
              innerbottompanel.add(GrandTotTxt);
              return innerbottompanel;
         public JPanel createInnerRightPanel(){
              innerrightpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerrightpanel.setBackground(TxtfontColor);
              innerrightpanel.setLayout(new BoxLayout(navrightpanel, BoxLayout.Y_AXIS));
              innerrightpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerrightpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalnextbtn = new JButton(createNextButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        getInnerFieldText(currentItem);
                        internalprevbtn.setEnabled(true);
                        if(currentItem < MaxItems){
                             ++currentItem;
                             orderDetails[CurrentRecord].getInnerCustOrdObj();
                             setInnerFieldText(currentItem);
                             System.out.println("Current Item" + currentItem);
                        if(currentItem == MaxItems){
                             internalnextbtn.setEnabled(false);
              innerrightpanel.add(internalnextbtn, GBC);
              return innerrightpanel;
         public JPanel createInnerLeftPanel(){
              innerleftpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerleftpanel.setBackground(TxtfontColor);
              innerleftpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerleftpanel.setForeground(Color.BLACK);
              innerleftpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalprevbtn = new JButton(createPreviousButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        getInnerFieldText(currentItem);
                        internalnextbtn.setEnabled(true);
                        if(currentItem == 1){
                             internalprevbtn.setEnabled(false);
                        if(currentItem > 0){
                             --currentItem;
                             orderDetails[CurrentRecord].getInnerCustOrdObj();
                             setInnerFieldText(currentItem);
                             System.out.println("Current Item" + currentItem);
              innerleftpanel.add(internalprevbtn, GBC);
              return innerleftpanel;
         public JPanel createCustOrdDetailsButtons(){
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor);
              externalprevbtn = new JButton(createPreviousButtonIcon());
              externalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalnextbtn.setEnabled(true);
                        if(CurrentRecord == 1){
                             externalprevbtn.setEnabled(false);
                        if(CurrentRecord > 0){
                             --CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println("Current Record " + CurrentRecord);//Checking RECORD_NUM
              buttonpanel.add(externalprevbtn);
              addrecordbtn = new JButton("Add Record", createAddButtonIcon());
              addrecordbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             MaxRecord = readRecordNumber();
                             MaxRecord++;
                             CurrentRecord = MaxRecord;
                             orderDetails[CurrentRecord] = new CustOrdObject();
                             writeRecordNumber(MaxRecord);
                             MaxItems = 1;
                             innerCustOrdObj[MaxItems] = new InnerCustOrdObject();
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             CustIDTxt.setText("");
                             CustOrderIDTxt.setText(""+MaxRecord);
                             //Get today's date
                             Date todaydate = new Date();
                             OrderedDateTxt.setText(""+simpleDF.format(todaydate));
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             GrandTotTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             externalnextbtn.setEnabled(false);
                             externalprevbtn.setEnabled(true);
                             System.out.println(MaxRecord);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(addrecordbtn);
              savebtn = new JButton("Save Data", createSaveButtonIcon());
              savebtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        setFieldText(CurrentRecord);
                        setInnerFieldText(MaxItems);
                        writeOrder();
                        writeRecordNumber(MaxRecord);
                        System.out.println(CurrentRecord);
                        System.out.println(MaxRecord);
              buttonpanel.add(savebtn);
              java.net.URL imageURL_AddRowIcon = CommonFeatures.class.getResource("Icons/edit_add.png");
              ImageIcon AddRowIcon = new ImageIcon(imageURL_AddRowIcon);
              additemreqbtn = new JButton("Add Item", AddRowIcon);
              additemreqbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             //CurrentRecord = MaxRecord;
                             MaxItems++;
                             innerCustOrdObj[MaxItems] = new InnerCustOrdObject();
                             System.out.println("Max Items "+MaxItems);
                             currentItem = MaxItems;
                             orderDetails[CurrentRecord].setMaxItems(MaxItems);
                             ///setInnerFieldText(currentItem);
                             internalnextbtn.setEnabled(false);
                             internalprevbtn.setEnabled(true);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(additemreqbtn);
              externalnextbtn = new JButton(createNextButtonIcon());
              externalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalprevbtn.setEnabled(true);
                        if(CurrentRecord < MaxRecord){
                             ++CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
                        if(CurrentRecord == MaxRecord){
                             externalnextbtn.setEnabled(false);
              buttonpanel.add(externalnextbtn);
              gotorecordbtn = new JButton("Go To Record", createGotoButtonIcon());
              gotorecordbtn.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt){
                         * The text from the GotorecordTxt textfield will be taken and assigned
                         * to a temporary integer variable called Find. 
                        int Find = Integer.parseInt(CustOrderIDTxt.getText());
                        for(int j=1; j <= MaxRecord; j++){
                              * Using a for loop, each record can be read using the readCustRecord
                              * method.
                             getFieldText(j);
                              * An if condition is utilized to check whether the temporary stored variable, Find,
                              * matches a field in a record. If this record is found, then using the RecordExists
                              * which was declared at the top, either a true or false statement can be assigned
                              * If the record exists, then a true statement will be assigned, if not a false
                              * statement will be assigned.
                             if(orderDetails[j].getCustOrderID() == Find){
                                  RecordExists = true;
                                  break;
                             }else{
                                  RecordExists = false;
                        if(RecordExists == false){
                              * If the RecordExists is assigned a false statement, then a message will be
                              * displayed to show that the record does not exist.
                             JOptionPane.showMessageDialog(null, "Record Does Not Exist!", "Error Message", JOptionPane.ERROR_MESSAGE, createErrorIcon());
                        }else{
                             getFieldText(Find);
              buttonpanel.add(gotorecordbtn);
              return buttonpanel;
         //TODO
         public void setFieldText(int orderID){//TODO
              orderDetails[orderID].setCustID(Integer.parseInt(CustIDTxt.getText()));
              orderDetails[orderID].setCustOrderID(Integer.parseInt(CustOrderIDTxt.getText()));
              orderDetails[orderID].setOrderDate(OrderedDateTxt.getText());
              orderDetails[orderID].setInnerCustOrdObj(innerCustOrdObj);
              orderDetails[orderID].setMaxItems(MaxItems);
              setInnerFieldText(currentItem);
              orderDetails[orderID].setGrandTotal(Float.parseFloat(GrandTotTxt.getText()));
         public void setInnerFieldText(int currentItem){//TODO
              innerCustOrdObj[currentItem] = new InnerCustOrdObject();
              innerCustOrdObj[currentItem].setMaxItems(MaxItems);
              innerCustOrdObj[currentItem].setItemNumber(Integer.parseInt(ItemNumberTxt.getText()));
              innerCustOrdObj[currentItem].setUnitPrice(Float.parseFloat(UnitPriceTxt.getText()));
              innerCustOrdObj[currentItem].setQuantityRequired(Integer.parseInt(QuantityReqTxt.getText()));
              innerCustOrdObj[currentItem].setTotalPrice(Float.parseFloat(TotPriceTxt.getText()));
         public void getFieldText(int orderID){
              CustIDTxt.setText(Integer.toString(orderDetails[orderID].getCustID()));
              CustOrderIDTxt.setText(Integer.toString(orderDetails[orderID].getCustOrderID()));
              OrderedDateTxt.setText(""+orderDetails[orderID].getOrderDate());          
              currentItem = orderDetails[orderID].getMaxItems();
              orderDetails[orderID].getInnerCustOrdObj();
              System.err.println("currentItem" + currentItem);
              //getInnerFieldText(currentItem);
              GrandTotTxt.setText(Float.toString(orderDetails[orderID].getGrandTotal()));
         public void getInnerFieldText(int currentItem){
              ItemNumberTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getItemNumber()));
              UnitPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getUnitPrice()));
              QuantityReqTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getQuantityRequired()));
              TotPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getTotalPrice()));
         public void writeOrder(){//TODO
              try {
                   objOut = new ObjectOutputStream(new FileOutputStream(OrderDetailsFile));
                   objOut.writeObject(orderDetails);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              } catch (IOException e) {
                   e.printStackTrace();
         public Object readOrder(){
              Object temporaryObj;
              try{
                   objIn = new ObjectInputStream(new FileInputStream(OrderDetailsFile));
                   temporaryObj = objIn.readObject();               
                   CustOrdObject[] blah = (CustOrdObject[]) temporaryObj;
                   /*               System.out.println("Outer: "+blah[1].getCustID());
                   InnerCustOrdObject[] whee = blah[1].getInnerCustOrdObj();
                   System.out.println("Inner: "+whee[1].getItemNumber());*/
                   objIn.close();
                   System.out.println("Read Worky!");
                   return temporaryObj;
              }catch(Exception e){
                   e.printStackTrace();
                   System.out.println("Read No Worky!");
                   return null;
         public void writeRecordNumber(int MaxRecord){
              try{
                   objOut = new ObjectOutputStream(new FileOutputStream(OrdRecordNumStore));
                   objOut.writeObject(MaxRecord);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              }catch(Exception e){e.printStackTrace();}
         public int readRecordNumber() {
              try {
                   objIn = new ObjectInputStream(new FileInputStream(OrdRecordNumStore));
                   int temporaryObj = Integer.parseInt(objIn.readObject().toString());
                   objIn.close();
                   System.out.println("Read Number Worky!");
                   return temporaryObj;
              } catch (Exception e) {
                   e.printStackTrace();
                   System.out.println("Read Number No Worky!");
                   return -1;
    }Message was edited by:
    Kilik07

Maybe you are looking for

  • Qualificatio catalog in ECC-6.0

    Hi, Ananatha, Thanks for your prompt response regarding my posted querries related to LOP 1/2 day and Payroll. I have  to implement PD also here, in this i have configured Appraisal System and Training & Event management. Now Qualification Catalog is

  • How can I set page #'s in a text to update automatically?

    The book I'm working on has an introduction that quotes from the main text, and gives page numbers. How can I set these referenced page numbers to update automatically when I change the number of pages in the main text? The introduction and chapters

  • Re : Works on 32 bit Tomcat . fails in 64 bit Web Logic

    Hello All, When I try to decrypt using 32 bit tomcat ... i can decrypt the hex string but when I use 64 bit Web Logic for the same , I get javax.crypto.badpaddingexception , Invalid pad value.... any thoughts in code what is causing this ? The sample

  • WorkSpace/Schema Developer Security

    hi, i have a schema with some tables. some of our developers do not have certain access to some of the tables. Example: developer A (another oracle schema) does not have update, delete on table X, Y and Z. i created a workspace and associated the sch

  • Master-Detail Problem -ASAP!!

    HI I have a problem that i hope someone can help me with.. I have one JSP page that displays a listing that will either add new,update or delete.. I am using the bc4juix:table tag but the problem that i am getting is that on the other page which is t