Problem with japanese writing

Hi everyone!
I have problems whenever I want to write in japanese (hiragana, katakana or kanji). I first activated this option like two months ago and at first it was working pretty well, I wrote some documents in pages and word without problems. Then, all of a sudden, whenever I activate this method of entry from the keyboard preference pane, my computer starts freezing as soon as I write anything and it stays like that for about 5 minutes. I already repaired permissions and validated fonts but nothing seems to fix it. I need to be able to write in japanese because I study it and I constantly need to do homework. Do you have any ideas that could solve this problem?

I search the forum and I found a solution you gave to another user: deleting the JapaneseAnalisys folder in preferences, but after I did that, I could only write a couple words before the freezing appeared again, so I created a new user account, but  the same happened: I wrote "konnichiwa" in pages (in hiragana) and the freezing started again. So I guess it is a corruption problem but not as simple as you tought. Right now the only solution I see is to reinstall the whole OS. Do you have any other suggestion? Because I think that reinstalling the OS is a lot of work to solve such a "little" problem :s .

Similar Messages

  • Problem with file writing

    Hello, I have a problem with writing a file. My code is very simple..it takes a line from one file, a line from a second file, combines them, and writes them into the third file. However, the program never gets past the point where it creates the output file. Any help is appreciated.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MergeFiles extends JApplet implements ActionListener
        private final String filename = "mergedfiles.txt";
        BufferedReader f1in, f2in;
        FileOutputStream outputstream;
        JTextField f1f = new JTextField("file1.txt", 20);
        JTextField f2f = new JTextField("file2.txt", 20);
        String F1text, F2text, F3text;
        JLabel title = new JLabel("Merge files program! Press enter to merge!");
        JButton merge = new JButton("MERGE! MERGE! MERGE!");
        JLabel labelone = new JLabel("File one");
        JLabel labeltwo = new JLabel("File two");
        Container con = getContentPane();
        JPanel pane = new JPanel();
        GridBagConstraints c = new GridBagConstraints();
        public void makedisplay()
            Insets i = new Insets(10, 10, 10, 10);
            pane.setLayout(new GridBagLayout());
            pane.setBackground(Color.green);
            con.setBackground(Color.green);
            con.add(pane, BorderLayout.CENTER);
            con.add(title, BorderLayout.NORTH);
            c.weightx = 0;
            c.insets = i;
            c.gridy = 0;
            c.gridx = 0;
            pane.add(labelone, c);
            c.gridx = 1;
            pane.add(labeltwo, c);
            c.gridx = 0;
            c.gridy = 1;
            c.ipadx = 50;
            pane.add(f1f, c);
            c.gridx = 1;
            pane.add(f2f, c);
            c.gridx = 0;
            c.gridy = 2;
            c.gridwidth = 3;
            c.ipadx = 0;
            pane.add(merge, c);
        public void init()
            makedisplay();
            merge.addActionListener(this);
        public void actionPerformed(ActionEvent e)
            openfiles();
            File f = new File("H://mergefiles//mergedfile.txt");
            try {
                title.setText("AAA");
                BufferedWriter out = new BufferedWriter(new FileWriter(f));
                F1text = f1in.readLine();
                F2text = f2in.readLine();
                title.setText("BBB");
                F3text = "" + F1text + F2text;
                out.write("" + F3text);
                f1in.close();
                f2in.close();
                out.close();
             catch (IOException ex)
        public void openfiles()
            try
                BufferedReader f1in = new BufferedReader(new FileReader(f1f.getText()));
                title.setText("file one opened");
            catch (FileNotFoundException e)
                title.setText("File one not found!");
            try
                BufferedReader f2in = new BufferedReader(new FileReader(f2f.getText()));
                title.setText("File two opened");
            catch (FileNotFoundException e)
                title.setText("File two not found!");
    }

    Nevermind, I've fixed the problem...for some reason you can't use the writer with an applet. I've written some new code that works:
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MergeFiles2
        static String F1L = "", F2L = "";
        static File file1 = new File("H://mergefiles//file1.txt");
        static File file2 = new File("H://mergefiles//file2.txt");
        public static void main(String[] args) throws IOException
            PrintWriter out = new PrintWriter(new FileWriter("file3.txt"));
            BufferedReader f1in = new BufferedReader(new FileReader(file1));
            BufferedReader f2in = new BufferedReader(new FileReader(file2));
            while (F1L != null)
                F1L = f1in.readLine();
                if (F1L != null)
                    out.println(F1L);
            while (F2L != null)
                F2L = f2in.readLine();
                if (F2L != null)
                    out.println(F2L);
            out.close();
    }

  • Any common problems with Japanese sub-titles?

    Hi one and all,
    I have been asked to take on a project involving adding Japanese sub-titles to a series of videos. The translation will be provided (so I will have access to the Japanese text to create the titles), however I have never worked with Japanese Kanji inside of Premiere Pro (7.2.2). Therefore I was just wondering if anybody in the community could let me know if there are any common pitfalls I need to look out for when using non-Roman alphabets in titles?
    I have not imported any fonts for this so far. Kanji appears to display fine in the title window when pasted in and it exports fine as well.
    Any advice on this would be greatly appreciated before I say 'yes' and then find myself in a world of headaches.
    Many Thanks
    Josh

    Since post lacks information on what you have exactly done it could be useful to reiterate some points.
    In GNOME3 IBus should work from the box, provided you installed input method and added it in system settings (I use kkc). GNOME breaks all other input methods except IBus, so that is your porbably best shot.
    In other DE (or we should say more generic method) you should set environment variables and start input method daemon. For KDE and MATE (I start X with sddm) I put in .xprofile
    export GTK_IM_MODULE=fcitx
    export QT_IM_MODULE=fcitx
    export XMODIFIERS=@im=fcitx
    fcitx -d -r
    local/fcitx 4.2.8.5-6 (fcitx-im)
    local/fcitx-configtool 0.4.8-1
    local/fcitx-gtk2 4.2.8.5-6 (fcitx-im)
    local/fcitx-gtk3 4.2.8.5-6 (fcitx-im)
    local/fcitx-kkc 0.1.1-1
    local/fcitx-qt4 4.2.8.5-6 (fcitx-im)
    local/fcitx-qt5 0.1.3-1

  • Socket problem with reading/writing - server app does not respond.

    Hello everyone,
    I'm having a strange problem with my application. In short: the goal of the program is to communicate between client and server (which includes exchange of messages and a binary file). The problem is, when I'm beginning to write to a stream on client side, server acts, like it's not listening. I'd appreciate your help and advice. Here I'm including the source:
    The server:
    import java.io.IOException;
    import java.net.ServerSocket;
    public class Server
        public static void main(String[] args)
            ServerSocket serwer;
            try
                serwer = new ServerSocket(4443);
                System.out.println("Server is running.");
                while(true)
                    ClientThread klient = new ClientThread(serwer.accept());
                    System.out.println("Received client request.");
                    Thread t = new Thread(klient);
                    t.start();
            catch(IOException e)
                System.out.print("An I/O exception occured: ");
                e.printStackTrace();
    }ClientThread:
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.net.Socket;
    import java.net.SocketException;
    public class ClientThread implements Runnable
        private Socket socket;
        private BufferedInputStream streamIn;
        private BufferedOutputStream streamOut;
        private StringBuffer filePath;
        ClientThread(Socket socket)
                this.socket = socket;     
        public void run()
            try
                 this.streamIn = new BufferedInputStream(socket.getInputStream());
                 this.streamOut = new BufferedOutputStream(socket.getOutputStream());
                int input;
                filePath = new StringBuffer();
                System.out.println("I'm reading...");
                while((input = streamIn.read()) != -1)
                     System.out.println((char)input);
                     filePath.append((char)input);
                this.streamOut.write("Given timestamp".toString().getBytes());
                ByteArrayOutputStream bufferingArray = new ByteArrayOutputStream();
                  while((input = streamIn.read()) != -1)
                       bufferingArray.write(input);
                  bufferingArray.close();
                OutputStream outputFileStream1 = new FileOutputStream("file_copy2.wav");
                  outputFileStream1.write(bufferingArray.toByteArray(), 0, bufferingArray.toByteArray().length);
                  outputFileStream1.close();
                this.CloseStream();
            catch (SocketException e)
                System.out.println("Client is disconnected.");
            catch (IOException e)
                System.out.print("An I/O exception occured:");
                e.printStackTrace();
        public void CloseStream()
            try
                this.streamOut.close();
                this.streamIn.close();
                this.socket.close();
            catch (IOException e)
                System.out.print("An I/O exception occured:");
                e.printStackTrace();
    }The client:
    import java.io.*;
    public class Client
         public static void main(String[] args) throws IOException
              int size;
              int input;
              //File, that I'm going to send
              StringBuffer filePath = new StringBuffer("C:\\WINDOWS\\Media\\chord.wav");
              StringBuffer fileName;
              InputStream fileStream = new FileInputStream(filePath.toString());
            Connect connection = new Connect("127.0.0.1", 4443);
            String response = new String();
            System.out.println("Client is running.");
              size = fileStream.available();
              System.out.println("Size of the file: " + size);
            fileName = new StringBuffer(filePath.substring(filePath.lastIndexOf("\\") + 1));
            System.out.println("Name of the file: " + fileName);
            connection.SendMessage(fileName.toString());
            response = connection.ReceiveMessage();
            System.out.println("Server responded -> " + response);
            ByteArrayOutputStream bufferingArray = new ByteArrayOutputStream();
              while((input = fileStream.read()) != -1)
                   bufferingArray.write(input);
              bufferingArray.close();
            FileOutputStream outputFileStream1 = new FileOutputStream("file_copy1.wav");
              outputFileStream1.write(bufferingArray.toByteArray(), 0, bufferingArray.toByteArray().length);
              outputFileStream1.close();
              byte[] array = bufferingArray.toByteArray();
              for (int i = 0; i < array.length; ++i)
                   connection.streamOut.write(array);
              response = connection.ReceiveMessage();
    System.out.println("Server responded -> " + response);
    connection.CloseStream();
    Connect class:import java.io.*;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class Connect
    public Socket socket;
    public BufferedInputStream streamIn;
    public BufferedOutputStream streamOut;
    Connect(String host, Integer port)
    try
    this.socket = new Socket(host, port);
    this.streamIn = new BufferedInputStream(this.socket.getInputStream());
    this.streamOut = new BufferedOutputStream(this.socket.getOutputStream());
    catch (UnknownHostException e)
    System.err.print("The Host you have specified is not valid.");
    e.getStackTrace();
    System.exit(1);
    catch (IOException e)
    System.err.print("An I/O exception occured.");
    e.getStackTrace();
    System.exit(1);
    public void SendMessage(String text) throws IOException
    this.streamOut.write(text.getBytes());
    System.out.println("Message send.");
    public void SendBytes(byte[] array) throws IOException
         this.streamOut.write(array, 0, array.length);
    public String ReceiveMessage() throws IOException
         StringBuffer elo = new StringBuffer();
         int input;
         while((input = streamIn.read()) != -1)
              elo.append((char)input);
         return elo.toString();
    public void CloseStream()
    try
    this.streamOut.close();
    this.streamIn.close();
    this.socket.close();
    catch (IOException e)
    System.err.print("An I/O exception occured: ");
    e.printStackTrace();

    The problem that was solved here was a different problem actually, concerning different source code, in which the solution I offered above doesn't arise. The solution I offered here applied to the source code you posted here.

  • Problem with Japanese character Codes

    I have been working for a company which got a product to support the sms activities. We are developing a new feature which supports Japanese language as of now along with english. We developed a new character set called PDC which is a combination of the following Japanese character sets JIS + SHIFT- JIS+ KATAKANA + ASCII.
    I am using Java API Charsets.jar to convert the bytes using the respective character sets to a STRING and presenting the converted STRING on a JSP.
    The Problem is I am able to see the Jap Chars which belong to JIS + ASCII but not for KATAKANA and SHIFT-JIS.
    I am using the below page tag in JSP.
    <%@ page contentType="text/html; charset = JIS " %>
    I couldn't find any other tag specifically which supports all the character sets. Could some one please help me?
    Pradeep.

    Okay... you developed a new character set... that's great. How's the browser supposed to know anything abou it?
    Maybe just use UTF-8 which should support all of that and other languages as well and stop boxing yourself into a fixed charset.

  • Sequencing problem with Batch Writing

    I'm using TopLink - 9.0.3.5 and I want to use the registerAllObjects method from the UnitOfWork instead of registering each individually to batch write records to the db. Here is a snippet of what I'm doing:
    Session session = ToplinkUtils.getSession();
    session.getLogin().useBatchWriting();
    session.getLogin().dontUseJDBCBatchWriting();
    session.getLogin().setSequencePreallocationSize(200);
    session.getLogin().setMaxBatchWritingSize(200);
    session.getLogin().bindAllParameters();
    session.getLogin().cacheAllStatements();
    session.getLogin().useNativeSequencing();
    UnitOfWork uow = ToplinkUtils.getActiveUnitOfWork(userId, ip);
    for loop{
    Notification dao = (Notification)
    ToplinkUtils.createObject (Notification.class.getName());
    dao.setName("someName");
    dao.setAddress("someAddress");
    allObjects.add(dao);
    uow.registerAllObjects(allObjects);
    This is the error I'm getting:
    2007-03-06 15:28:40,482 DEBUG (11776:9:127.0.0.1) TOPLINK - JTS#beforeCompletion()
    2007-03-06 15:28:40,482 DEBUG (11776:9:127.0.0.1) TOPLINK - SELECT GMS_NOTIFICATION_SEQ.NEXTVAL FROM DUAL
    2007-03-06 15:28:40,497 DEBUG (11776:9:127.0.0.1) TOPLINK - INSERT INTO GMS_NOTIFICATION ...
    2007-03-06 15:28:40,716 DEBUG (11776:9:127.0.0.1) TOPLINK - EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3.5 (Build 436)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00001: unique constraint (GMSG2K.GMS_NOTIFICATION_PK) violated
    It appears that the next sequence number is aquired for the primary key and a record is added but when Toplink tries to add the next record either the sequence is not aquired or the same sequence number is being used.
    Do I need to set up a table in memory to acquire the sequences? Can anyone give me some guidence?
    thanks

    registerAllObjects() does not do anything special it just calls registerObject(), it does not affect batching.
    In 9.0.3 batch writing was not supported with parameter binding, so this is why you are not seeing batching. This support was added in 9.0.4.
    In 9.0.4 you should use,
    Session session = ToplinkUtils.getSession();
    session.getLogin().useBatchWriting();
    session.getLogin().setSequencePreallocationSize(200);
    session.getLogin().setMaxBatchWritingSize(200);
    session.getLogin().bindAllParameters();
    session.getLogin().cacheAllStatements();
    session.getLogin().useNativeSequencing();
    where setMaxBatchWritingSize(200) means 200 statements.
    In 9.0.3 you can only use dynamic batch writing, which may not perform well. For dynamic batch writing, setMaxBatchWritingSize(200) means 200 characters (the size of the SQL buffer) so is too small, the default is 32,000.
    If you are concerned about performance enabling sequence preallocation would also be beneficial.
    If you still get timeouts, you may consider splitting your inserts into smaller batches (100 per each unit of work) instead of all in a single transaction.

  • I am having weird problems with iDVD writing a disc.

    A funny thing happened to me in iDVD. I created a 1hr .mov file of a dance performance, added it to an iDVD project and tried to burn it to DVD. I had iDVD set to 'Best', but the text flashed red and I had to change the setting to 'High'. The disc was ok, but very poor quality when compared with the original HD .mov file created in iMovie.
    I decided to split the recording into two 30min segments. I went through the burn process again and when I checked the disc, the quality seemed slightly better.
    I popped in a second blank disc and made a second copy before iDVD lost the processed project.
    This is when the weird thing happened. Some how the disc was burnt with the full version of the .mov file, and not the 'part one' segment I had made. Then, when I created a new iDVD project and attempted to burn 'part two', again I got the whole 1hr .mov file. However, the original 1hr .mov file no longer existed. It only existed as two 30min .mov files. I checked the recordings were as I wanted them in iDVD before burning the DVDs.
    So, my question is, does iDVD hold some kind of memory of past files added. As it stands, though I have two 30min .mov files on my iMac, iDVD sees them as a previous incarnation as a single 1 hour .mov file and refuses to recognise the two 30 min .mov versions.

    Yes, iDVD can get confused when there are multiple versions of the file.  Try the command -- Delete Encoded Assets -- to refresh iDVD.  Or, you can create new iDVD projects for each of the 30 min segments.
    John

  • Problems with I/O on Unix Server

    HAllo
    I have a Problem with reading/writing on the Server my Tomcat is running.
    My Application does not find the properties file allthough i tried to get my path with System.getProperty("user.dir"), and also tried to set an absolute path too.
    It is also not able to create a new file.
    My Question: What rights do applications running in tomcat have by dafault?
    How cat i change this rights?
    And how do the path have to look in my code if i want to set it fix?
    I tried thid ones:
    "/mydir/myfile.txt"
    "\\mydir\\myfile.txt"

    Tomcat is a regular application that has the same rights as the user executing it. Does Tomcat run as a user who has access to the directory you are trying to read/write from?

  • Can't import AppleWorks spreadsheet with Japanese

    I can't import an AppleWorks spreadsheet with Japanese writing into Numbers. The fonts are all just like this.
    Å@Å@â∫ãLÇÃÇ∆Ç®ÇËå©êœÇËÇ¢ÇΩǵNjÇ∑ÅB
    In AppleWorks, the fonts are fine.

    How do I get AppleWorks to export to TAB delimited?
    Save As… text in the File Format drop-down menu. You will need to add the .txt extension to the file name. AppleWorks won't do it for you & Numbers may not recognize the file as one it can open without the extension.

  • English exe with Japanese XP

    Does anyone have any experience installing Labview executables (Host and RT Target PC) on a Host PC with Japanese XP installed?  If so, should I expect a lot of difficulty?

    I assume these people do, but I'm not sure how many English speakers you'll find there.
    For what it's worth, I can say that installing on Hebrew XP is not a problem, and I would guess there shouldn't be a problem with Japanese as long as you don't make presumption (e.g. using period instead of commas, OS directory names, etc.).
    Try to take over the world!

  • 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

  • Problem with JavaScript snipet that DreamWeaver is writing

    I am having a problem with code that DreamWeaver (CS3) is
    writing. I'm fairly certain the problem is in a small piece of
    JavaScript that DreamWeaver is composing.
    This is a fairly complex problem, so bear with me.
    First - What I am trying to make happen: When on a page on my
    site (the-oilman.com) I want a link that opens a new window in the
    on-line store at a different site (AMSOIL.com). I need to leave
    both the page on my site open and have this 'store' page open.
    First of all this is working fine, using the 'Open Window'
    'behavior' in DreamWeaver. If someone wants to change windows (or
    tabs) and go back to my page, leaving the 'store' window open also
    - the problem is set up to happen. If from back at my site, you
    click on the same or a different link that goes back to the 'store'
    either on the same page or a different page at AMSOIL.com - the
    'store' window goes to the correct page, but the 'store' window
    does NOT come on top. When they click on a link to go back to the
    'store' I need the 'store' window to come to the top. If they have
    previously put something in the cart, and come back and add
    something else to the cart in the 'store' by coming in from
    different links on my site the 'store' is working correctly because
    I leave it open the whole time.
    snipets of code that DreamWeaver is writing for my site
    (the-oilman.com):
    from the head:
    <script>
    <!--
    CSAct[/*CMP*/ '129AABC1'] = new Array(CSOpenWindow,/*URL*/ '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,true,true,tr ue,true,true);
    CSAct[/*CMP*/ '129AAC63'] = new Array(CSOpenWindow,/*URL*/ '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,true,true,tr ue,true,true);
    CSAct[/*CMP*/ '10D39F40'] = new Array(CSOpenWindow,/*URL*/ '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso','store',0,0,true,true,tru e,true,true,true,true);
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    //-->
    </script>
    code from 2 different links that is using this script:
    <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso"
    target="store" onClick="MM_openBrWindow('#','store','')"
    csclick="10D39F40">Buy Now</a>
    <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store"
    title="AMSOIL Store at AMSOIL.com" target="store"
    onClick="MM_openBrWindow('http:www.amsoil.com/redirect.cgi?zo=52257&amp;page=store','stor e','')">On
    Line Store</a>
    I believe what I need is a longer javascript. Instead of just
    "window.open" I need an "if" but my javascript knowledge is very,
    very limited.
    I need it to first check that if the window named 'store' is
    open then 'focus' it, or if it is not open to open the window named
    'store'.
    Will this fix my problem? If so, please help me write the
    lines of code to do it.
    If this isn't the solution, what is the problem and the
    solution?
    A separate question but related: if you look in the two
    different links codes, in the function call one of them uses a
    'null' page reference and the other repeats the full link reference
    from the href= . Both seem to work, but which is the correct or the
    preferred syntax. My guess is there are some browsers that this
    will give a problem, but which way is preferred.
    Don Dawson
    mailto:[email protected]

    Create a new page. Try to apply this same behavior to a link
    on that new
    page. Look at the code. Can you reproduce the problem there?
    The code you
    show below has oodles of GL stuff in it. Do you need that GL
    markup?
    What operational sequence did you go through to get this
    behavior call?
    onClick="MM_openBrWindow('#','store','')"
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "pad graphics" <[email protected]> wrote in
    message
    news:[email protected]...
    >I am having a problem with code that DreamWeaver (CS3) is
    writing. I'm
    >fairly
    > certain the problem is in a small piece of JavaScript
    that DreamWeaver is
    > composing.
    >
    > This is a fairly complex problem, so bear with me.
    >
    > First - What I am trying to make happen: When on a page
    on my site
    > (the-oilman.com) I want a link that opens a new window
    in the on-line
    > store at
    > a different site (AMSOIL.com). I need to leave both the
    page on my site
    > open
    > and have this 'store' page open. First of all this is
    working fine, using
    > the
    > 'Open Window' 'behavior' in DreamWeaver. If someone
    wants to change
    > windows (or
    > tabs) and go back to my page, leaving the 'store' window
    open also - the
    > problem is set up to happen. If from back at my site,
    you click on the
    > same or
    > a different link that goes back to the 'store' either on
    the same page or
    > a
    > different page at AMSOIL.com - the 'store' window goes
    to the correct
    > page, but
    > the 'store' window does NOT come on top. When they click
    on a link to go
    > back
    > to the 'store' I need the 'store' window to come to the
    top. If they have
    > previously put something in the cart, and come back and
    add something else
    > to
    > the cart in the 'store' by coming in from different
    links on my site the
    > 'store' is working correctly because I leave it open the
    whole time.
    >
    > snipets of code that DreamWeaver is writing for my site
    (the-oilman.com):
    > from the head:
    > <script>
    > <!--
    > CSAct[/*CMP*/ '129AABC1'] = new
    Array(CSOpenWindow,/*URL*/
    > '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,t
    > rue,true,true,true,true);
    > CSAct[/*CMP*/ '129AAC63'] = new
    Array(CSOpenWindow,/*URL*/
    > '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store','store',0,0,true,true,t
    > rue,true,true,true,true);
    > CSAct[/*CMP*/ '10D39F40'] = new
    Array(CSOpenWindow,/*URL*/
    > '
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso','store',0,0,tr
    > ue,true,true,true,true,true,true);
    > /
    > function MM_openBrWindow(theURL,winName,features) {
    //v2.0
    > window.open(theURL,winName,features);
    > }
    > //-->
    > </script>
    >
    > code from 2 different links that is using this script:
    > <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=storefront/sso"
    > target="store" onClick="MM_openBrWindow('#','store','')"
    > csclick="10D39F40">Buy
    > Now</a>
    > <a href="
    http://www.amsoil.com/redirect.cgi?zo=52257&page=store"
    > title="AMSOIL
    > Store at AMSOIL.com" target="store"
    >
    onClick="MM_openBrWindow('http:www.amsoil.com/redirect.cgi?zo=52257&amp;page=sto
    > re','store','')">On Line Store</a>
    >
    > I believe what I need is a longer javascript. Instead of
    just
    > "window.open" I
    > need an "if" but my javascript knowledge is very, very
    limited.
    > I need it to first check that if the window named
    'store' is open then
    > 'focus'
    > it, or if it is not open to open the window named
    'store'.
    > Will this fix my problem? If so, please help me write
    the lines of code to
    > do
    > it.
    > If this isn't the solution, what is the problem and the
    solution?
    >
    > A separate question but related: if you look in the two
    different links
    > codes,
    > in the function call one of them uses a 'null' page
    reference and the
    > other
    > repeats the full link reference from the href= . Both
    seem to work, but
    > which
    > is the correct or the preferred syntax. My guess is
    there are some
    > browsers
    > that this will give a problem, but which way is
    preferred.
    >
    > Don Dawson
    > mailto:[email protected]
    >

  • TS1646 hello  I have problem with regist my visa and I cannot buy from store the message came in the end of form is says the phone number must be a 7-digit number and I have writed but not accepted iam from saudi arabia my mobile is 966504850992 pls answe

    hello 
    I have problem with regist my visa and I cannot buy from store
    the message came in the end of form is says
    the phone number must be a 7-digit number
    and I have writed but not accepted
    iam from saudi arabia
    my mobile is 966504850992
    pls answer
    thanks
    dfr aldossary

    Wow, Karan Taneja, you've just embarrassed yourself on a worldwide support forum.  Not only is your post ridiculous and completely inappropriate for a technical support forum, but it also shows your ignorance as to whom you think the audience is.  Apple is not here.  It's users, like you. 
    If you would have spent half the time actually reading the Terms of Use of this forum that YOU agreed to by signing up to post, as you did composing that usesless, inappropriate post, you (and the rest of us on this forum) would have been much better off.

  • Problem with writing continuous data to excel using using Report Generation vi's

    Hey Everyone,
    I am trying to read the data from DAQ and write to excel continuously using Report Generation vi's. 
    But when I run the VI, it writes only one interation of the while loop (gathering data from DAQ continuously) and doesn't append the data into the same file when I run it again after stoping the VI. 
    I have attached the VI i created. Please let me know if you have any idea to solve this issue. 
    Thanks
    Attachments:
    sample 5.vi ‏35 KB

    There are two problems with your VI.  First, the basic logic of writing/appending to a file (Excel, TDMS, anything) should go something like this:  Open the file, position yourself at the end of the file, then, in the loop, acquire data and write it to the file until you are finished with data acquisition.  When you exit the acquire/write to file loop, then close the file.  In particular, the opening and the closing of the file should not be inside the loop.
    As others have pointed out, writing to Excel might not be optimal, particularly if you are acquiring data at a high rate (and would therefore be writing a lot of data). We actually use Excel in our data acquisition routine, mainly reading from a WorkSheet to get the parameters of a particular stimulus, but also writing the outcome of the response to the stimulus.  As it happens, our "acquisition rate" in this example is on the order of several samples per minute, so there's no problem using Excel (we also sample 16 channels of analog data at 1 KHz -- this gets written as a binary file).
    Second, if you really do want to use Excel, use the (existing) Excel file to which you want to append as the "template" argument of the New Report function.  Then use the Excel Get Last Row function to position yourself at "end of file", as noted above.
    Good Luck.
    Bob Schor

  • Problem in working with Japanese data

    Hello,
    We have an application, which should work for both English and Japanese languages. Our application is working fine for English data but in case of Japanese, we are facing problems. In the application, there is a language setting, where the user can select either English or Japanese. This changes the language of the labels to English or Japanese. We are handling this thru' ResourceBundles. But the data that is entered can be independent of this. In English setting also, the data entered or diplayed could be Japanese. Now we are facing problems at vaious places -
    1. When we enter Japanese data and save it, it gets copied into the bean and if there is any error in the saving, the same data from bean comes back on the screen. This data doesn't appear properly in Japanese.
    2. When we try to retrieve the already saved data from database, it doesn't show poperly in Japanese.
    We are using our own 'toUnicode' function, which converts the data to Unicode before saving the data to database. Similarly, we have tried different encodings like SJIS / Shift_JIS / ISO-2022-JP at various places i.e. in 'Page' directive or in HTML Meta tag or various combinations of these two. Nothing is working reliably. Sometimes for some combination, data retained in the first case is correct but it can't be saved. Sometimes it works with Unicode, sometimes without Unicode. Some combination affects the Japanese labels as well. Otherwise the labels at least are displayed properly.
    The same code with just Shift_JIS setting in 'page' directive, worked well in IIS Server for both English and Japanese.
    What could be the problem in WebLogic? Does it matter if WL is installed on English or Japanese machine?
    Kindly answer ASAP, since the project is getting delayed.
    Thanking in anticipation...
    -Medha

    Hi,
    is there a difference in handling Japanese and Chinese chars? If not I
    might be able to give you some hints.
    Daniel
    -----Original Message-----
    From: JSB [mailto:[email protected]]
    Posted At: Monday, February 12, 2001 6:22 PM
    Posted To: internationalization
    Conversation: Problem in working with Japanese data
    Subject: Re: Problem in working with Japanese data
    Have u solved this yet, and how ?
    Medha <[email protected]> wrote in message
    news:[email protected]...
    >
    Hello,
    We have an application, which should work for both English andJapanese
    languages. Our application is working fine for English data but in case
    of
    Japanese, we are facing problems. In the application, there is a
    language
    setting, where the user can select either English or Japanese. This
    changes
    the language of the labels to English or Japanese. We are handling this
    thru' ResourceBundles. But the data that is entered can be independent
    of
    this. In English setting also, the data entered or diplayed could be
    Japanese. Now we are facing problems at vaious places -
    1. When we enter Japanese data and save it, it gets copied into thebean
    and if there is any error in the saving, the same data from bean comes
    back
    on the screen. This data doesn't appear properly in Japanese.
    2. When we try to retrieve the already saved data from database, itdoesn't show poperly in Japanese.
    We are using our own 'toUnicode' function, which converts the datato
    Unicode before saving the data to database. Similarly, we have tried
    different encodings like SJIS / Shift_JIS / ISO-2022-JP at various
    places
    i.e. in 'Page' directive or in HTML Meta tag or various combinations of
    these two. Nothing is working reliably. Sometimes for some combination,
    data
    retained in the first case is correct but it can't be saved. Sometimes
    it
    works with Unicode, sometimes without Unicode. Some combination affects
    the
    Japanese labels as well. Otherwise the labels at least are displayed
    properly.
    The same code with just Shift_JIS setting in 'page' directive,worked
    well in IIS Server for both English and Japanese.
    What could be the problem in WebLogic? Does it matter if WL isinstalled on English or Japanese machine?
    Kindly answer ASAP, since the project is getting delayed.
    Thanking in anticipation...
    -Medha

Maybe you are looking for

  • Training Need - TN in Training and Event Management

    Hi Did any one worked on Training Need (TN) in Training and event management? I have the below question. For France there is a legal requirement to capture some 1.6 % of the employee annual gross salary towards training cost.  So where to record the

  • Attempting to connect a Apple Laserwriter 4/600 to a MacPro.

    Hello. I have recently obtained an AsantéTalk to help me connect my Apple Laserwriter 4/600PS to my MacPro which is presently running on OSX10.6.8. Everything is correctly wired and connected but nothing seems to print. I have used both red and blue

  • Need to write query results to .xls file

    Hi All, My requirement is ,when i run a query from sqlplus the results should be copied to a excel sheet.But i am not able to generate the file in the correct format.Could some body please help on this.. Thanks in advance Thanks [email protected]

  • My color palete isn't working

    Hi, I have a problem with Photoshop Elements 12 editior. When I pick a color (for example I picked blue) and start to draw it will only come out as a light grey color. I scanned a photo and put it into Photoshop Elements 12 editor and im using a waco

  • How to calculate the data as per accounting year

    I want to dispaly the result for  the accounting year from April to March for any accounting year (Accounting year is from April to March). I have a table INVOICE. CREATE TABLE INVOICE   IN_NO       NUMBER,   IN_DT       DATE,   IN_DETAILS  VARCHAR2(