Problem with writing into txt file on the Web

Hello friends - please could you give me an advice? Java console says:
Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.io.FilePermission http:\web.telecom.cz\jiriczech\xanado.txt write)
Thank you a lot in advance:)!!

The place you are trying to write the file to does not have write permission.

Similar Messages

  • HT204382 Hi, Ive just got myself a Macbook Pro, and Im having problems with sound on movie files. The format is wmv and they play OK on a windows 7 laptop, and Im trying to play them now on the MAC. The picture is OK , but no sound. I have Flip4Mac - no d

    Hi, Ive just got myself a Macbook Pro, and Im having problems with sound on movie files. The format is wmv and they play OK on a windows 7 laptop, and Im trying to play them now on the MAC. The picture is OK , but no sound. I have Flip4Mac - no diference

    Download and install the free VLC for Mac - that should work:
    http://www.videolan.org/vlc/download-macosx.html

  • Problem when I upload txt files to the server

    Hi, I have a problem when I try to upload files to the server, and I can't understand the fail.
    My case is:
    I have a jsp page where a from is.
    This form is sended to a servlet that proccess its content and upload the attach file to the server.
    It works correctly (it uploads the files, txt, xls and csv), the problem is when I try to upload a txt file like this, for example:
    Depth     Age
    0     0,1
    2     0,9
    3     2
    5     6
    6     9
    8     12
    34     25
    56     39
    101     40When I verify the uploaded file, this one has a character extra of return of line (a small square). This character prevents me from working then correctly with the file, on having detected a column of more.
    Which can be the problem?
    The code I use to uploaded the file is:
    try
        MyConnection Objconnection = new MyConnection();
        boolean isMultipart = FileUpload.isMultipartContent(req);
        // Create a factory for disk-based file items
        FileItemFactory factory = new DiskFileItemFactory();
         // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        // Set overall request size constraint
        upload.setSizeMax(1024*512); //524288 Bytes (512 KB)
         // Parse the request
        List items = upload.parseRequest(req);
        // Process the uploaded items
        Iterator iter = items.iterator();
        String dat = new String();
        String typeFile = new String();
        while (iter.hasNext())
            FileItem item = (FileItem) iter.next();
            if (item.getFieldName().equals("typeFile") )
                typeFile = item.getString();
            if (!item.isFormField())
            String fieldName = item.getFieldName();
            String fileName = item.getName();
            String contentType = item.getContentType();
            boolean isInMemory = item.isInMemory();
            long sizeInBytes = item.getSize();
            int numbers=0;
            for(int i=fileName.length();(i=fileName.lastIndexOf('\\',i-1))>=0;)
                 numbers++;
            String stringFile[] = fileName.split("\\\\");
            HttpSession session = req.getSession(true);
            String loginSesion = (String)session.getAttribute("UserLogin");
            String newUserFolder = loginSesion;
            File createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder);
            if ("AgeModel".equals(typeFile))
                createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder);
            if (!createFile.exists())
                createFile.mkdir();
            fileName = stringFile[numbers];
            File uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder+"/"+fileName);
            if ("AgeModel".equals(typeFile) )
                uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder+"/"+fileName);
            existe = Objconnection.existFile(fileName, typeFile, loginSesion);
            if ( true == existe )
                 exito = false;
            else
                item.write(uploadedFile);
                ....// NOW REGISTER THE FILE IN TH DATA BASE
        } // if (!item.isFormField())
    } // WHILE ( iter.hasNext() )
                catch(Exception e) {
                out.println("Error de Aplicaci�n " + e.getMessage());
                return exito;
    ...THANKS

    Hi,
    Sorry I am aware this question was posted way back, but I am having similar problem and haven't been able to find the fix yet.
    So please let me known if you have got any ideas.
    My problem is same that I have to upload a CSV file from Client Machine (Windows) to Unix Application Server.
    I am using JSP method post and multipart/form-data (as in http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml).
    The file is uploaded fine but the problem is it displays carraige Return (^M) a square boxes on Unix file.
    I can't ask user to convert file to Unox format before uploading. They just convert excel file to CSV and upload.
    Is there any way I can get rid of these characters as I have to use this file further.
    Sorry, I can't use any paid utility or tool for it.
    I would appreciate if you could please help.
    Thanks,
    SW

  • Problem with creating a new file in the Filter

    hi,
    i have the following problem.
    1) For all requests ending with *.xml (for example requests such as http://www.asdf.com/feeds/myfile.xml ) i have mapped it to a filter
    2 ) In the filter i did the following...................
    //getting the file name from the url
    //create the file if it does not exists..................
    chain(request,reponse);
    //done
    problem is
    3) a) For files which iam not creating in filter (i.e files which are already there) the response is proper it is returning a xml file
    b) But for files which are not there already , which we are creating in the filter dynamically it is showing a 404 (i.e file not found message)
    But if i refresh again in the browser it is getting a valid XML file.......................................
    I could not able to figure it out why it is returning 404 error in cases where the file is being created dynamically.................................
    Can any one guide me resolving this problem?

    Hi pawan
    Try this badi :   MB_MIGO_BADI  -
    (BAdI in MIGO for External Detail Subscreens)  as the name suggest ,
    If you want to add a screen in header level use : Method : PBO_header an code as :
        e_cprog   = 'ZMMPRM0001'.     """ Your screen created
        e_dynnr   = '1000'.                     "Your screen No
        e_heading = 'TEXT ID '(004).    """" Name of the screen to be created .
      ELSE .
        e_cprog   = 'ZMMPRM0001'.
        e_dynnr   = '1000'.                     "External fields: Display
        e_heading = 'TEXT ID '."(004).
    or if at item level
    u can use methid : PBO_DETAIL
    for item level screen creation . and code in the same maaner ..
    You can explore the remaning methods as per your requirements .
    Hope it helps ..!
    Regrads
    Swapnil P KAmble

  • Problems with plain text (.txt) files

    I recently needed some tech. info to be loaded on my PlayBook (OS2.1), but I found that I could not open the files when on location. I had downloaded PlainTextEdit and several others, and have Ghost Commander file manager (which claims to be able to open text files, but none of the apps could find the files - they seem to be searching a different location from that used by the built in File Manager app - which sees the files, but can't locate a program to open them (I had transferred the files both from my Mac desktop and through DropBox).
    Does anyone know why this is happening?
    I have since taken to putting files on as PDF's, which works fine, but I'm still concerned that there are apps on my Playbook that are searching unknown locations.
    Solved!
    Go to Solution.

    Air Browser showed me the Android files that the other apps were searching - I can now move my files into that location.
    can you tell us the folder location for each of those two apps ?
    Maybe it would be nice if it was displayed in the help section of each of those two apps?
    Do you think you will contact those two  developers ?
    Hi Xandrex,
    What I see in AirBrowser is the normal file structure as shown by the built in file manager app, PLUS a directory called Miscelaneius, which contains a directory called 'Android', which is what the other apps (I assume they are both Android ports) search - they don't seem to be able to see the regular Playbook file structure.
    Using AirDrop as you suggested, I am able to copy my files into this Android file structue, and work on them.
    It would be very nice if Android ports could read the correct file structure, or at least warn users in advance, but as I am not likely to need any more apps, I won't bother to contact the developers about correcting this - even if they can, given the BB OS's emphasis on security.
    Thanks again for your help,
    Rhenner

  • Problems with PSE 10 when saving for the web.

    I'm having problems saving for web with PSE 10. I edit in RAW, edit in PSE 10, save as Jpeg, resize and save for the web.  Results are muddled and not sharp (looks cartoonish). Also, there is no metadata when you look at the image properties.  I uninstalled the program and installed again. No change.

    Are you resizing the photo before save for web?
    What settings are you using in the save for web dialog for the jpeg quality?
    If you compress the jpeg too much (low quality settings below 60), that can make your photos look bad.
    And save for the web in pse 10 automatically strips any metadata in order to keep the file sizes smaller.
    Also, the save for web in pse 10 has a bad habit of not remembering your last used settings, so it's good to verify that your actually set to jpeg instead of the default GIF setting.
    Message was edited by: R_Kelly

  • Problems with running reports having parameters, on the web

    Dear all,
    I have recently installed Oracle 9iAS v1.0.2.2.1 on Suse linux 7.3. Also, installed
    Forms and Reports 6i alongwith it.
    Building and running reports both static and ones that accept parameters was a breeze.
    I could also run reports from the web successfully until now when I am trying to run a
    report that accepts parameters.
    When I enter the following URL:
    http://<webserver>/cgi-bin/rwcgi60?report=<some.rdf >userid=<user/passwd@db>
    server=<reportservername>destype=cachedesformat=html+paramform=yes
    This is what happens:
    1. I am prompted for a parameter value in the html format
    2. On entering a suitable value, I am prompted for information to connect to the
    database viz. username, password and database name
    3. Entering suitable values for the above results in a hung state. There is no output and
    the busy signal is all that I get for a long long time.
    4. Also, stopping this session results in other such sessions resulting in a hung state, too.
    That is to say, if I had run a report throug the web successfully before trying this
    one, after aborting this session, I cannot re-run the previous successful report. That
    too results in a hung state. I have to restart the reports server rwmts60 once again
    as well as the web server for things to work smoothly.
    I tried recreating the cgi env and ran a strace on the rwcgi60 command. It produces
    an error saying 'libzrc60.so.0: no such file or directory' where as it is very much
    present in the default LD_LIBRARY_PATH. This could be misleading as I am not sure
    how I correct I was in re-creating the CGI env.
    This is a problem I face only when I enter the "paramform=yes" option in the URL.
    Also, excuse me for my ignorance , but I have no idea how to interpret the cgicmd.dat file.
    It does mention that %P, %PT, %PC are amongst the currently recognised special
    parameters, though.
    Will someone please help me out asap as this is quite urgent.
    Thanks a million in advance
    Hema

    Hi Hema,
    There could be various things that explain this, but from your symptoms it looks like the engine is hung processing this report. This could be as simple as a PL/SQL trigger that is in an infinite loop. Anyway, a simple thing to do is to add TRACEFILE=filename&TRACEMODE=append&TRACEOPTS=TRACE_ALL onto your URL. This will create the specified file and dump information into it about what Reports is doing as it is processing your report. If it is hung in an infinite loop, you should be able to see how far it got when you kill it.
    Also, you can see the status of the reports job queue by using the http://.../rwcgi60?showjobs command. If the report is executing forever, you'll see it sitting there in the job queue.
    regards,
    Stewart

  • I've switched from Google to Firefox because I was so tired of Google crashed all the time. Now I have the same problem with Firefox, Bank id, file down

    Hej!
    I've switched from Google to Firefox because I was so tired of Google crashed all the time. Now I have the same problem with Firefox, Bank id, file downloading, accessing Web pages, none of it works. What is the error?
    Ronnie.

    When Firefox crashes, it usually records information about what was happening at that moment and displays the Mozilla Crash Reporter. Are you seeing that, or is Firefox just freezing and you're killing it?
    Assuming you have crashes, you can submit that data to Mozilla and share it with forum volunteers to see whether it points to the solution. Please check the support article "[[Firefox Crashes]]" (especially the last section) for steps to get those crash report IDs, and then post some of the recent ones here.
    If that's not possible, have you tried Firefox's Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using either:
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * Help menu > Restart with Add-ons Disabled
    Not all add-ons are disabled: Flash and other plugins still run
    After Firefox shuts down, a small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).
    Any difference?

  • Why do I get a NI-488 error massage when writing into a file and at the same time copiyng this file with a backup softwarre like Easy2Sync?

    I have a small LabVIEW program which writes random numbers very fast into a ASCII-file. I want that file to be copied to a new position every 10 min. Therefor I use a backup/synchronisation software which is doing a copy operation every 10 min. It works fine a certian amount of time and after a while I get either an LabVIEW error (LabVIEW: Fiel already open: NI-488 Comand requieres GPIB Controller to be System controller) or an backup-software error (couldn´t open file...whatever). I´m guessing, it has something to do with file-access but I don´t know why?!? If I run the LabVIEW program and I copy and paste the random-number-file with the windows explorer very fast (pressing ctrl+v rapidly) while LabVIEW is still writing into this file, no error appears. Can sombody help me?
    LabVIEW 2011

    Hi Serdj,
    you don't get a GPIB error, the error number has just 2 different explanations...
    Well, you have two programs accessing the same file. One program just wants to make a copy, the other (LabView) is trying to write to the file. When copying a file that is written to you get inconsistent results! That's why one of both programs is complaining an error...
    You can't have write and read access at the same time! (But you can have more than one read access at the same time...)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Problems with writing to file, and with ActionListener.

    I have been trying to write a Payroll Division type program as my school Computer Science Project. However, I have a few problems with it...
    import java.io.IOException;
    import java.io.FileOutputStream;
    import java.io.FileInputStream;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.util.StringTokenizer;
    import javax.swing.*;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.*;
    public class Personnel implements ActionListener  {    
             JFrame GUIFrame;
             JLabel ID, Line, OKText,AnswerField;
             JTextField IDField, LineField;
             JButton OK;
             JPanel GUIPanel;
             int trialCounter=0;
             final static int employeeNumber = 7;
             final static int maxValue = ((employeeNumber*4)-1);
            //Number of employees, which would be in real life passed by the Payroll division.   
            public static String [][] sortHelp = new String [employeeNumber+1][3];    /** Creates a new instance of Personnel */       
            public Personnel() {
              GUIFrame = new JFrame("PersonnelSoft"); //create title header.
                     GUIFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                     GUIFrame.setSize(new Dimension(100, 140));
                     GUIPanel= new JPanel(new GridLayout(2, 2));
                     addWidgets();
                     GUIFrame.getRootPane().setDefaultButton(OK);
                     GUIFrame.getContentPane().add(GUIPanel, BorderLayout.CENTER);
                     GUIFrame.pack();
                    GUIFrame.getContentPane().setVisible(true);
                    GUIFrame.setVisible(true);
            private void addWidgets() {
                  ID = new JLabel ("Please enter your employee Identification Number:", SwingConstants.LEFT);
                  IDField = new JTextField ("ID", 5);
                  Line = new JLabel ("Please enter the line of your payroll with which you have concerns:", SwingConstants.LEFT);
                  LineField = new JTextField ("###", 2);
                  OKText = new JLabel ("Click OK when you have verified the validity of your request", SwingConstants.LEFT);
                  OK = new JButton ("OK");
                  OK.setVerticalTextPosition(AbstractButton.CENTER);
                  OK.setMnemonic(KeyEvent.VK_I);
                  AnswerField = new JLabel("The Result of your Querie will go here", SwingConstants.LEFT);
                  GUIPanel.add(ID);
                  GUIPanel.add(IDField);
                  GUIPanel.add(Line);
                  GUIPanel.add(LineField);
                  GUIPanel.add(OKText);
                  GUIPanel.add(OK);
                  GUIPanel.add(AnswerField);
                  OK.addActionListener(this);
                  ID.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
                  OKText.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
                  Line.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            public static void ArrayCreate() throws IOException {   
              //creates a employeeNumber x 3 array, which will hold all data neccessary for future sorting by employee ID number.      
              int counter = 2;      
              int empCounter = 1;      
              String save;
              //avoid having to waste memory calculating this value every time the for loop begins 
              FileInputStream inFile = new FileInputStream("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR.txt"); 
              BufferedReader in = new BufferedReader(new InputStreamReader(inFile));
              String line;
                    line = in.readLine();
                    StringTokenizer st = new StringTokenizer(line);
                    save = st.nextToken();
                    sortHelp[0][0] = save;
                    sortHelp[0][2] = save;
                    while (st.hasMoreTokens()) {
                    save = st.nextToken();   
                    sortHelp[0][1] = save;
                    while (counter <= maxValue) {
                    line = in.readLine();
                    if (((counter - 1) % 4) == 0) {
                    st = new StringTokenizer(line);
                    sortHelp[empCounter][0] = st.nextToken();
                    sortHelp[empCounter][2] = sortHelp[empCounter][0];
                    while (st.hasMoreTokens()) {
                    save = st.nextToken();   
                    sortHelp[empCounter][1] = save;
                    empCounter++;
                    counter++;
                 public static String[] joinString() {
                      String[] tempStorage = new String[employeeNumber+1];
                      int counter;
                      for (counter = 0; counter <= employeeNumber; counter++) {
                           tempStorage[counter] = (sortHelp[counter][1] + sortHelp[counter][0]);
                      return (tempStorage);
                 public static String[] sortEm(String[] array, int len)
                     java.util.Arrays.sort(array);
                     return array;
                 public static void splitString(String[] splitString){
                    int counter;
                    for (counter = 0; counter <= employeeNumber; counter++){
                         sortHelp[counter][0]=splitString[counter].substring( 5 );
                         sortHelp[counter][1]=splitString[counter].substring(0,5);
                 void setLabel(String newText) {
                     AnswerField.setText(newText);
                 void writetoHR(String local) throws IOException {
                      FileOutputStream outFile = new FileOutputStream ("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR2.txt");
                       BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outFile));
                       out.write(local+"the preceding employee number is not in our database, but has submitted a request. Please sort out the issue");
                       System.exit(0);
                 public void actionPerformed(ActionEvent e){
                      boolean flag=false;
                      String local=IDField.getText();
                      int i=0;
                      while((i<=employeeNumber)&&(flag==false)){
                           if (sortHelp[1]==local) {
                   flag=true;
              i++;
         trialCounter++;
         if (trialCounter>=3)
              writetoHR(local);
         if (flag==false)
              setLabel("Your ID number does not exist in our records. Verify your ID and try again.");
         else {
              switch (LineField.getText())
              case 04:
                   setLabel("Your pay is calculated by multiplying your working hours by the amount per hour. If both of these fields are satisfactory to you, please contact humanresource");
                   break;
              case 03:
                   setLabel("Hourly amount was calculated by the system, by dividing your yearly pay 26 and then 80.");
                   break;
              case 07:
                   setLabel("Overtime pay was calculated by multiplying regular hourly pay by 1.1");
                   break;
              case 06:
                   setLabel("The overtime hourly pay was multiplied by the amount of overtime hours.");
                   break;
              case 10:
                   setLabel("For holiday hours, your pay is increased by 25%.");
                   break;
              case 09:
                   setLabel("The holiday hourly pay was multiplied by your amount of holiday hours.");
                   break;
              case 11:
                   setLabel("Your total pay was calculated by adding all the separate types of payment to your name.");
                   break;
              case 17:
                   setLabel("Your net pay was found by subtracting the amount withheld from your account");
                   break;
              case 19:
                   setLabel("Your sick hours remaining were taken from a pool of 96 hours.");
                   break;
              default:
                   setLabel("Please contact humanresource.");
              break;
    private static void CreateAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
    Personnel GUI = new Personnel();
         public static void main(String[] args) throws IOException {
              String[] temporary = new String[employeeNumber];
              ArrayCreate();
    temporary = joinString();
    temporary = sortEm(temporary, employeeNumber);
    splitString(temporary);
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    CreateAndShowGUI();
    int row;
    int column;
         for (row = 0; row < (employeeNumber); row++) {    // verify proper output by ArrayCreate splitString
    for (column = 0; column <= 2; column++) {
    System.out.print(sortHelp[row][column]);
    System.out.print(' ');
    System.out.print(' ');
    System.out.println();
    1) It does not permit me to switch on a String. How do I solve that?
    2)How would I throw an exception (IO) within actionperformed?
    3)Generally, if cut it down to everything except the writing to a file part, the actionperformed script causes an error... why?
    Thanks in advance.
    And sorry for the relative lameness of my question...
    ---abe---

    Thank you very much. That did solve almost all the problems that I had...
    I just have one more problem.
    First (here's the new code):
    import java.io.IOException;
    import java.io.FileOutputStream;
    import java.io.FileInputStream;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.util.StringTokenizer;
    import javax.swing.*;
    import java.util.*;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.*;
      public class Personnel implements ActionListener  {    
             JFrame GUIFrame;
              JLabel ID, Line, OKText,AnswerField;
               JTextField IDField, LineField;
               JButton OK;
               JPanel GUIPanel;
               int trialCounter=0;
         final static int employeeNumber = 7;
         final static int maxValue = ((employeeNumber*4)-1);
                public static String [][] sortHelp = new String [employeeNumber+1][3];   
         public Personnel() {
              GUIFrame = new JFrame("PersonnelSoft"); //create title header.
             GUIFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             GUIFrame.setSize(new Dimension(100, 140));
             GUIPanel= new JPanel(new GridLayout(2, 2));
             addWidgets();
             GUIFrame.getRootPane().setDefaultButton(OK);
             GUIFrame.getContentPane().add(GUIPanel, BorderLayout.CENTER);
             GUIFrame.pack();
            GUIFrame.getContentPane().setVisible(true);
            GUIFrame.setVisible(true);
            private void addWidgets() {
                  ID = new JLabel ("Please enter your employee Identification Number:", SwingConstants.LEFT);
                  IDField = new JTextField ("ID", 5);
                  Line = new JLabel ("Please enter the line of your payroll with which you have concerns:", SwingConstants.LEFT);
                  LineField = new JTextField ("###", 2);
                  OKText = new JLabel ("Click OK when you have verified the validity of your request", SwingConstants.LEFT);
                  OK = new JButton ("OK");
                  OK.setVerticalTextPosition(AbstractButton.CENTER);
                  OK.setMnemonic(KeyEvent.VK_I);
                  AnswerField = new JLabel("The Result of your Querie will go here", SwingConstants.LEFT);
                  GUIPanel.add(ID);
                  GUIPanel.add(IDField);
                  GUIPanel.add(Line);
                  GUIPanel.add(LineField);
                  GUIPanel.add(OKText);
                  GUIPanel.add(OK);
                  GUIPanel.add(AnswerField);
                  OK.addActionListener(this);
                  ID.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
                  OKText.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
                  Line.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            public static void ArrayCreate() throws IOException {   
              int counter = 2;      
              int empCounter = 1;      
              String save;
              FileInputStream inFile = new FileInputStream("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR.txt"); 
              BufferedReader in = new BufferedReader(new InputStreamReader(inFile));
              String line;
                    line = in.readLine();
                    StringTokenizer st = new StringTokenizer(line);
                    save = st.nextToken();
                    sortHelp[0][0] = save;
                    sortHelp[0][2] = save;
                    while (st.hasMoreTokens()) {
                    save = st.nextToken();   
                    sortHelp[0][1] = save;
                    while (counter <= maxValue) {
                    line = in.readLine();
                    if (((counter - 1) % 4) == 0) {
                    st = new StringTokenizer(line);
                    sortHelp[empCounter][0] = st.nextToken();
                    sortHelp[empCounter][2] = sortHelp[empCounter][0];
                    while (st.hasMoreTokens()) {
                    save = st.nextToken();   
                    sortHelp[empCounter][1] = save;
                    empCounter++;
                    counter++;
                 public static String[] joinString() {
                      String[] tempStorage = new String[employeeNumber+1];
                      int counter;
                      for (counter = 0; counter <= employeeNumber; counter++) {
                           tempStorage[counter] = (sortHelp[counter][1] + sortHelp[counter][0]);
                      return (tempStorage);
                 public static String[] sortEm(String[] array, int len)
                     java.util.Arrays.sort(array);
                     return array;
                 public static void splitString(String[] splitString){
                    int counter;
                    for (counter = 0; counter <= employeeNumber; counter++){
                         sortHelp[counter][0]=splitString[counter].substring( 5 );
                         sortHelp[counter][1]=splitString[counter].substring(0,5);
                 void setLabel(String newText) {
                     AnswerField.setText(newText);
                 void writetoHR(String local) throws IOException {
                      FileOutputStream outFile = new FileOutputStream ("C:\\Documents and Settings\\Abraham\\humanresource4\\src\\humanresource4\\HR2.txt");
                       BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outFile));
                       out.write(local+"the preceding employee number is not in our database, but has submitted a request. Please sort out the issue");
                       System.exit(0);
                 public void actionPerformed(ActionEvent e){
                      boolean flag=false;
                      String local=IDField.getText();
                      local trim();
                      int i=0;
                      while((i<employeeNumber)&&(flag==false)){
                           if (sortHelp[1]==local) {
                   flag=true;
              else {
         i++;
         trialCounter++;
         if (trialCounter>=3)
              try {
                   writetoHR(local);
              } catch (IOException exception) {
    setLabel("We are sorry. The program has encountered an unexpected error and must now close");
              } finally {
         if (flag==false)
              setLabel("Your ID number does not exist in our records. Verify your ID and try again.");
         else {
              final Map m = new HashMap();
              m.put("04","Your pay is calculated by multiplying your working hours by the amount per hour. If both of these fields are satisfactory to you, please contact humanresource.");
              m.put("03", "Hourly amount was calculated by the system, by dividing your yearly pay 26 and then 80.");
              m.put("07", "Overtime pay was calculated by multiplying regular hourly pay by 1.1");
              m.put("06", "The overtime hourly pay was multiplied by the amount of overtime hours.");
              m.put("10", "For holiday hours, your pay is increased by 25%.");
              m.put("09", "The holiday hourly pay was multiplied by your amount of holiday hours.");
              m.put("11", "Your total pay was calculated by adding all the separate types of payment to your name.");
              m.put("17", "Your net pay was found by subtracting the amount withheld from your account.");
              m.put("19", "Your sick hours remaining were taken from a pool of 96 hours.");
    setLabel(m.get(LineField.getText()));
    private static void CreateAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
    Personnel GUI = new Personnel();
    public static void main(String[] args) throws IOException {
              String[] temporary = new String[employeeNumber];
              ArrayCreate();
    temporary = joinString();
    temporary = sortEm(temporary, employeeNumber);
    splitString(temporary);
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    CreateAndShowGUI();
    int row;
    int column;
         for (row = 0; row < (employeeNumber); row++) {    // verify proper output by ArrayCreate splitString
    for (column = 0; column <= 2; column++) {
    System.out.print(sortHelp[row][column]);
    System.out.print(' ');
    System.out.print(' ');
    System.out.println();
    Now that code above produces two errors. First of all.
    local trim();produces the error:
    Syntax error, insert "AssignmentOperator ArrayInitializer" to complete ArrayInitializerAssignementSecondly, if I take that into comments, the line
    setLabel(m.get(LineField.getText()));Produces the error:
    The method setLabel(String) in the type Personnel is not applicable for the arguments (Object)If anybody could help me solve these, I would be sincerely thankfull.
    Now, before anybody asks as to why I want to trim the String in the first place, it is due to the fact that I compare it to another String that is without whitespaces. Thus the field that DOES have whitespaces was preventing me from launching into the if loop:
    if (sortHelp[1]==local) {
                   flag=true;
    (within actionperformed) Or at least that's my explanation as to why the loop never launched. If it is wrong, can somebody please explain?)
    I apologize for the horrible indentation and lack of comments. This is an unfinished version.. I'll be adding the comments last (won't that be a joy), as well as looking for things to cut down on and make the program more efficient.
    Anyways,
    Thanks in Advance,
    ---abe---

  • Java.io.NotSerializableException when overwrite the JTable data into .txt file

    hi everyone
    this is my first time to get help from sun forums
    i had java.io.NotSerializableException: java.lang.reflect.Constructor error when overwrite the JTable data into .txt file.
    At the beginning, the code will be generate successfully and the jtable will be showing out with the data that been save in the studio1.txt previously,
    but after i edit the data at the JTable, and when i trying to click the save button, the error had been showing out and i cannot succeed to save the JTable with the latest data.
    After this error, the code can't be run again and i had to copy the studio1.txt again to let the code run 1 more time.
    I hope i can get any solution at here and this will be very useful for me.
    the following is my code...some of it i create it with the GUI netbean
    but i dunno how to attach my .txt file with this forum
    did anyone need the .txt file?
    this is the code that suspect maybe some error here
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    String filename = "studio1.txt";
              try {
                  FileOutputStream fos = new FileOutputStream(new File(filename));
                  ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(jTable2);
                   oos.close();
              catch(IOException e) {
                   System.out.println("Problem creating table file: " + e);
                   return;
              System.out.println("JTable correctly saved to file " + filename);
    }the full code will be at the next msg

    this is the part 1 of the code
    this is the full code...i had /*....*/ some of it to make it easier for reading
    package gui;
    import javax.swing.*;
    import java.io.*;
    public class timetables extends javax.swing.JFrame {
        public timetables() {
            initComponents();
        @SuppressWarnings("unchecked")
        private void initComponents() {
            jDialog1 = new javax.swing.JDialog();
            buttonGroup1 = new javax.swing.ButtonGroup();
            buttonGroup2 = new javax.swing.ButtonGroup();
            buttonGroup3 = new javax.swing.ButtonGroup();
            buttonGroup4 = new javax.swing.ButtonGroup();
            jTextField1 = new javax.swing.JTextField();
            jLayeredPane1 = new javax.swing.JLayeredPane();
            jLabel6 = new javax.swing.JLabel();
            jTabbedPane1 = new javax.swing.JTabbedPane();
            jScrollPane3 = new javax.swing.JScrollPane();
            jTable2 = new javax.swing.JTable();
            jScrollPane4 = new javax.swing.JScrollPane();
            jTable3 = new javax.swing.JTable();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
    /*       org.jdesktop.layout.GroupLayout jDialog1Layout = new org.jdesktop.layout.GroupLayout(jDialog1.getContentPane());
            jDialog1.getContentPane().setLayout(jDialog1Layout);
            jDialog1Layout.setHorizontalGroup(
                jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 400, Short.MAX_VALUE)
            jDialog1Layout.setVerticalGroup(
                jDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 300, Short.MAX_VALUE)
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jLayeredPane1.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);
            String filename1 = "studio1.txt";
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   jTable2 = (JTable) ois.readObject();
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
            try {
                   ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename1));
                   jTable3 = (JTable) ois.readObject();
                   System.out.println("reading for " + filename1);
              catch(Exception e) {
                   System.out.println("Problem reading back table from file: " + filename1);
                   return;
            jTable2.setRowHeight(20);
            jTable3.setRowHeight(20);
            jScrollPane3.setViewportView(jTable2);
            jScrollPane4.setViewportView(jTable3);
            jTable2.getColumnModel().getColumn(4).setResizable(false);
            jTable3.getColumnModel().getColumn(4).setResizable(false);
            jTabbedPane1.addTab("STUDIO 1", jScrollPane3);
            jTabbedPane1.addTab("STUDIO 2", jScrollPane4);
            jTextField1.setText("again n again");
            jLabel6.setText("jLabel5");
            jLabel6.setBounds(0, 0, -1, -1);
            jButton2.setText("jButton2");
            jButton1.setText("jButton1");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
          

  • A problem with importing layered PSD file into Flash

    Hi.
    There's a problem with importing layered PSD file into Flash.
    If I import a layered PSD file, some part the color of the lower layer is shown at the edge of objects or shadows. Instead, if I crop each layers first and import them, there's no problem.
    If the higher layer has brush or transparent effects, it becomes worse.
    Any help with this problem?
    Thanks.

    How was the original art created? Was the original RGB or CMYK? What is the resolution of the Photoshop file? Flash only works well with RGB and 72 pixel per inch resolution. If your original art is not set this way, then Flash will attempt to convert it as it imports it. Flash uses the sRGB color space. You'll get the best color translation if your Photoshop file is using this color preference.

  • How to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scripting

    how to get all how to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scriptingstyle and their fonts of a  indesign file and write all info with para info into txt file with scripting

    I write the script this one works
              var par=doc.stories.everyItem().paragraphs.everyItem().getElements();
      for(var i=par.length-1;i>=0;i--)
           var font=par[i].appliedParagraphStyle.name;
            var font1=par[i].appliedFont.name;
             var size=par[i].pointSize;
            WriteToFile (par[i].contents  +   "\r" +  "Style  : " + font  + "\r" +  "FONT1  : " + font1  + "\r" +  "Size  : " + size  + "\r", reportFilePath);
                            function WriteToFile(text, reportFilePath) { 
        file = new File(reportFilePath); 
        file.encoding = "UTF-8"; 
        if (file.exists) { 
            file.open("e"); 
            file.seek(0, 2); 
        else { 
            file.open("w"); 
          file.writeln(text);  
        file.close(); 
    Thanks for all your support

  • I have problems with seeing my bookmarks, file, view, edit...buttons. I tried other shortcuts. I noticed that all of my bookmarks are located in the Internet Explorer browsers, how can I restore setting back to Mozilla Firefox?

    I have problems with seeing my bookmarks, file, view, edit...buttons. I tried other shortcuts. I noticed that all of my bookmarks are located in the Internet Explorer browsers, how can I restore setting back to Mozilla Firefox?

    Is the menu bar missing (the one containing File, View, Edit etc)? If it is, the following link shows how to restore it - https://support.mozilla.com/kb/Menu+bar+is+missing

  • I have a problem with running an EXE file on win2000, the Lab View is 5.1 and I do not know if it is 16 bit...

    I have a problem with running an EXE file on win2000, the Lab View is 5.1 and I do not know if it is 16 bit...what should I do?

    Hi Arika,
    The drivers that you need to install to make your executable work depends on what your executable is doing. To get started, you need to have the LabVIEW Run-Time Engine installed on your target machine (the Win2000 machine you are planning to use) in order to run your executable. Next, you need to determine what drivers your executable uses, if any. For example, if you are using GPIB instrument control, you will need to install the NI-488 drivers on your target machine. If you are performing data acquisition, you will need to install NI-DAQ drivers. If you are doing image acquistion, you will need to install NI-IMAQ drivers.
    All these drivers are available for downloading on ni.com. To get the drivers, go to ht
    tp://www.ni.com/support , click on the link that takes you to Drivers and Updates (under Option 3), and click on the links to get to the driver(s) you need. For example, if you need the LabVIEW 5.1.1 Run-Time engine, click on the All Drivers and Updates by Application link on the main page (http://www.ni.com/softlib.nsf/). Then click on the LabVIEW link, Windows 2000, Run Time Engine, and then you will see the link to get to the page to download the LabVIEW 5.1.1 Run-Time Engine.
    I hope this information helps.
    Best Regards,
    Wilbur Shen
    National Instruments

Maybe you are looking for