Identifier expected error......plzz help

it is showing the error ....identifier expected where i am declaring the variables JTextArea and JButton....
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.swing.filechooser.*;
import javax.swing.SwingUtilities.*;
//import javax.swing.JEditorPane;
import java.net.URL;
public class tm extends JPanel implements ActionListener
     public static void main(String args[]) throws Exception
     JTextArea = program, input, state;
     JButton = loadp, run, step,loadi;
     public tm()
          JPanel c = new JPanel();
          c.setLayout(new GridLayout(1,1));
          loadi = new JButton("LOAD INPUT STRING");
          contentPane.add(loadi);
          loadi.addActionListener(this);
          loadp = new JButton("LOAD PROGRAM");
          contentPane.add(loadp);
          loadp.addActionListener(this);
          run = new JButton("RUN");
          contentPane.add(run);
          run.addActionListener(this);
          step = new JButton("STEP");
          contentPane.add(step);
          step.addActionListener(this);
          program=new JTextArea("");
          program.setBounds(100,400,100,400);
          input=new JTextArea("");
          input.setBounds(300,400,200,50);
          state=new JTextArea("");
          state.setBounds(700,400,100,50);
     public void actionPerformed(ActionEvent e)
       try{
         if(e.getSource()==loadp)
              JFileChooser chooser=new JFileChooser();
               int r= chooser.showOpenDialog(this);
               if(r==JFileChooser.APPROVE_OPTION)
                    String name=chooser.getSelectedFile().getName();
                    File f=chooser.getSelectedFile();
                    FileInputStream filestream = new FileInputStream(f); 
                    BufferedInputStream bufferstream = new BufferedInputStream(filestream); 
                    DataInputStream datastream = new DataInputStream(bufferstream); 
                    String record = null;
                    tapep.setText("");
                    try { 
                           while ( (record=datastream.readLine()) != null )
                              program.append(record);                         
                        catch (Exception p)
                          System.out.println(p);                      
          else if(e.getSource()==run)
          else if(e.getSource()==step)
          else if(e.getSource()==loadi)
       catch(Exception t)
            System.out.println(t);
}

     public static void main(String args[]) throws Exception
     JTextArea = program, input, state;
     JButton = loadp, run, step,loadi;That's not valid Java syntax.
The Java? Tutorial - Trail: Learning the Java Language
~

Similar Messages

  • identifier expected error when trying to create a class instance?

    public static Time time;
    //Cannot find symbol package1.Controller - both have the same package statement.
    //When the 2nd line is included ony that is flagged as giving an error
    //Gives <identifier> expected
    public static Time time;
    time = new Time();
    //Simply typing:
    time = new Time();
    //does too
    The classes look like:
    package package1;
    public class Controller extends Applet
    public static Time time;
    time = new Time();
        public void init()
         this.setLayout(new FlowLayout());
         Panel panel = new Panel();
         add(Time.timeP);
        public void paint()
         //Some stuff here
    package package1;
    import java.awt.*;
    import java.io.*;
    public class Time extends Panel implements Runnable
        public static Panel timeP;
        public Time() {timeP = new Panel();}
         //Some other unrelated stuff here
    }

    Sorry, i forgot about that.
    public static Time time = new Time();/*Gives
    cannot find symbol
    symbol: class Time
    location class package1.Controller
    cannot find symbol
    symbol: class Time
    location class package1.Controller
    It looks like it's looking for the Time class in the Controller class?

  • Keep getting   " identifier expected" error

    I keep getting that error, but I have not code which requires use of an <identifier>. I've been staring at this screen for like 3 hours now and I cant figure it out...Any help is greatly appreciated
    public class ConTest
            Scanner scan = new Scanner(System.in);
            char c = 'z';
            String choice;
            String temp;
            System.out.println("Choose one of the following operations:");
            System.out.println("    - Infix to postfix conversion (enter the letter i)");
            System.out.println("    - Postfix expression evaluation (enter the letter p)");
            System.out.println("    - Arithmetic expression evaluation (enter the letter a)");
            System.out.println("    - Quit (enter the letter q)");
            while(c != 'q' && c != 'Q'){
                System.out.println("Which operation do you want? ");
                choice = scan.nextLine();
                c = choice.charAt(0);
                switch(c)
                    case 'A':
                    case 'a':
                        System.out.println("Input your infix expression:\n");
                        temp = Converter.infixToPostfix(scan.nextLine());
                        System.out.println("The value of the arithmetic expression is " +
                            Converter.postfixValue(temp) + "\n");
                        break;
                    case 'I':
                    case 'i':
                        System.out.println("Input your infix expression:\n");
                        System.out.println("The postfix expression is " + Converter.infixToPostfix(scan.nextLine())
                            + "\n");
                        break;
                    case 'P':
                    case 'p':
                        System.out.println("Input your postfix expression:\n");
                        System.out.println("The value of the postfix expression is " +
                            Converter.postfixValue(scan.nextLine()) + "\n");
                        break;
                    case 'Q':
                    case 'q':
                        System.out.println("quitting\n");
                        break;
                    default:
                        System.out.println("Invalid choice\n");
    }It's just some code to test my infixToPostfix and postfixValue static methods of a separate class.

    System.out.println("Choose one of the following operations:");How do you expect this line of code (and the ones following it) to be executed? They are not inside any valid place. They need to be in a method, constructor, or initializer block (and maybe I left out a couple of other terms, but the point is you have these lines of code in an illegal place.

  • Ios 5 3194 error plzz help

    hey ho can help me to fix the error or its apple crowed servers ?

    I had this same problem when helping a friend download it to his iPhone. I switched to his wife's computer and it downloaded fine. So you might want to try to download the update from another computer.

  • Finished Installation..ERROR in starting the SERVER PLZZ HELP

    Hi,
    I could complete the installation of SAP WAS from the cd with host n keller successfully.
    But now when i make a set up and try to logon with the SAP GUI , It gives an error saying the host couldnt be find and in the meanwhile on ABAP ENGINE STARTUP SCREEN it starts the server and then immediately shuts down showing : Work process xx died..and ICM shut down successful.
    Plzz help me as to if any settings are causing this or wat should i do to splve this.
    Thanks,
    Shilpi

    Hi,
    Did you configure loopback adapter and assigned a ip address to it? If it is done, then try to increase virtual memory.
    Sabita

  • Syntax error on token "Enum", Identifier expected

    Hello,
    We are using the LinkType class(com.sapportals.wcm.repository.enum.LinkType) but at the import statement we get an error message: Syntax error on token "Enum", Identifier expected
    Configuration:
    JDK version: jdk1.5.0_17
    NWDS 7.1 SP7 CE
    import com.sapportals.wcm.repository.enum.LinkType;
    Has anyone experienced the same issue and found a workaround or solution?
    Regards,
    Edwin.

    Thanks, but that is not the problem... Unfortunately.
    The class we needed (linkType) is found in the KM API for NWDS 04, but this KM API is not available anymore in NWDS 7.1...
    So we will have to redesign the application and re-do the developments...
    Regards,
    Edwin.

  • Error in compile smol program identifier expected

    I CAN'T Compile this code - the ansuer <identifier> expected
    the code
    // Exercicio - Ticker.java
    import java.applet.*;
    import java.awt.*;
    public class Ticker extends Applet implements Runnable {
    private volatile Thread tickerThread = null;
    String tickertext = "Exercicio - fita do registrador";
    int tickerSpeed = 1;
    String tickerFontName = "TimesRoman";
    int tickerFontSize = 12;
    Font tickerFont = null;
    String tickerDirection = "Left";
    Dimension tickerSize = null;
    int tickerTextWidth = 0;
    int tickerHeight = 0;
    int tickerPosition = -63000;
    public void init() {
    if (getParameter("tickerText") != null) {
    tickerText = getParameter("tickerText");
    if (getParameter("tickerSpeed") != null) {
    tickerSpeed = Integer.parseInt(getParameter("tickerSpeed"));
    if (getParameter("tickerFontName") != null) {
    tickerFontName = getParameter("tickerFontName");
    if (getParamenter("tickerFontSize") != null); {
    tickerFontSize = Integer.parseInt(getParameter("tickerFontSize"));
    tickerFont = new java.awt.Font(tickerFontName, Font.PLAIN, tickerFontSize);
    if (getParameter("tickerReverse") == null) {
    tickerDirection = "Left";
    tickerPosition = -63000;
    else {
    tickerDirection = "Right";
    tickerPosition = 63000;
    this.setBackground(Color.white);
    public void start() {
    if (tickerThread == null) {
    tickerThread = new Thread(this);
    tickerThread.start();
    public void stop() {
    tickerThread = null;
    public void run() {
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    Thread thisThread = Thread.currentThread();
    while (thisThread == tickerThread) {
    try {
    Thread.sleep(10);
    catch (InterruptedException e) {}
    repaint();
    public void paint(Graphics ticker) {
    tickerSize = getSize();
         ticker.setFont(tickerFont);
         if (tickerTextHeight == 0) {
    tickerTextHeight = ticker.getFontMetrics().getHeight();
    if (tickerTextWidth == 0) {
         tickerTextWidth = ticker.getFontMetrics().stringWidth(tickerText);
    if (tickerDirection == "Left") {
    if (tickerPosition <= tickerTextWidth * -1) {
    tickerPosition = tickerSize.width ;
    else {
    tickerPosition = tickerPosition - tickerSpeed;
    else {
    if (tickerPosition > tickerTextWidth) {
    tickerPosition = 0 - tickerSize.width ;
         else {
                             tickerPosition = tickerPosition + tickerSpeed;
              ticker.setColor(Color.black);
              ticker.drawString(tickerText, tickerPosition, (tickerSize.height + tickerTextHeight) / 2);

    Hello,
    The last *}* is not placed on the correct line... It should be after the two last lines:
        ticker.setColor(Color.black);
        ticker.drawString(tickerText, tickerPosition,(tickerSize.height + tickerTextHeight) / 2);
    }since ticker is known only in paint meethod...
    By the way, using code tags makes things easier for us to help...
    Hope this helps

  • Whenever i try to open my after effect it just says error 15 n dont work plzz help me out

    whenever i try to open my after effect it just says error 15 n dont work plzz help me out

    We cannot know. you are not telling us anything about your system, what kind of project, what footage etc. We don't even know what version of AE!!! In any case, run the Creative Suite Cleaner Tool, reinstall the program. If the issues persist, we realyl need a lot more info to help you.
    Mylenium

  • HT1338 tried to update 10.7.4 to 10.7.5 get un expected error at cleanup....have tried several times with no success..after failed try mail will not open because the mail is now incompatible with 10.7.4......HELP

    tried to update 10.7.4 to 10.7.5 get un expected error at cleanup....have tried several times with no success..after failed try mail will not open because the mail is now incompatible with 10.7.4......HELP

    2009 MacBook Pro eh? It looks like your hard drive has failed. Three years is pretty standard. Often, then only hint you have is catastrophic failure.
    If you put the old hard drive into an external enclosure or similar device, you may still be able to migrate your data from it. Just because it won't boot doesn't mean you can't still read from it. Still, I wouldn't keep trying it. As long as you are buying a new hard drive, may as well get sometime to use with Time Machine too.

  • identifier expected with ArrayList in JDK5RC

    Just started with J2SE1.5 but still am unable to compile. Already fixed the generics.
    Error is <identifier> expected. See code.
    Who can help me with this? I am stuck :-(
    import java.util.List;
    import java.util.Vector;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import javax.swing.table.AbstractTableModel;
    public class TableWithVectorData extends JFrame {
         private JTable table;
         private Model model;
         public static void main(String[] arg) {
              TableWithVectorData t = new TableWithVectorData();
              t.setVisible(true);
              t.setSize(new Dimension(600, 300));
              t.validate();
         public TableWithVectorData() {
              super("Walter's Table Demo");
              model = new Model(); // getDummy2Data());
              table = new JTable(model);
              JScrollPane scrollPane = new JScrollPane(table);
              getContentPane().add(scrollPane);
         public class Model extends AbstractTableModel {
              public static final int MAC_CODE_COL = 0;
              public static final int MAC_NAME_COL = 1;
              public static final int IP_COL = 2;
              public static final int OS_COL = 3;
              public static final int DOMAIN_COL = 4;
              public List<String> colNames = new ArrayList<String>();
              // the next line gives error message <identifier> expected
              // api doc: public boolean add(E o)
              colNames.add("Machine Code");
              colNames.add("Machine Name");
              colNames.add("IP Address");
              colNames.add("Operating System");
              colNames.add("Domain");
              public List<Class> colTypes = new ArrayList<Class>();
              colTypes.add(Integer.class);
              colTypes.add(String.class);
              colTypes.add(String.class);
              colTypes.add(String.class);
              colTypes.add(String.class);
              public List<MachineData> data = new Vector<MachineData>();
              data.add(new Integer(100), "Robert", "288.209.140.223", "Win NT", "Engineering");
              data.add(new Integer(105), "Rahul", "288.209.140.214","Solaris 5", "Engineering");
              data.add(new Integer(110), "Daina", "288.209.140.220","HP UX", "Engineering");
              public void SimpleTableModel() { // List macDataVector) {
                   super();
                   //m_macDataVector = macDataVector;
              public int getColumnCount() {
                   return colNames.size();
              public int getRowCount() {
                   return data.size();
              public void setValueAt(Object value, int row, int col) {
                   MachineData mD = (MachineData) data.get(row);
                   switch(col) {
                        case MAC_CODE_COL : mD.setMacCode((Integer) value);
                             break;
                        case MAC_NAME_COL : mD.setMacName((String) value);
                             break;
                        case IP_COL : mD.setMacIP((String) value);
                             break;
                        case OS_COL : mD.setMacOS((String) value);
                             break;
                        case DOMAIN_COL : mD.setMacDomain((String) value);
                             break;
              public String getColumnName(int col) {
                   return colNames[col];
              public Class getColumnClass(int col) {
                   return colTypes[col];
              public Object getValueAt(int row, int col) {
                   MachineData mD = (MachineData) data.get(row);
                   switch(col) {
                        case MAC_CODE_COL : return mD.getMacCode();
                        case MAC_NAME_COL : return mD.getMacName();
                        case IP_COL : return maD.getMacIP();
                        case OS_COL : return mD.getMacOS();
                        case DOMAIN_COL : return mD.getMacDomain();
                   return new String();
         public class MachineData {
              private Integer m_macCode;
              private String m_macName;
              private String m_macIP;
              private String m_macOS;
              private String m_macDomain;
              public MachineData() {
              public MachineData (Integer macCode, String macName, String macIP, String macOS, String macDomain) {
                   m_macCode = macCode;
                   m_macName = macName;
                   m_macIP = macIP;
                   m_macOS = macOS;
                   m_macDomain = macDomain;
              public Integer getMacCode() {
                   return m_macCode;
              public String getMacName() {
                   return m_macName;
              public String getMacIP() {
                   return m_macIP;
              public String getMacOS() {
                   return m_macOS;
              public String getMacDomain() {
                   return m_macDomain;
              public void setMacCode(Integer macCode) {
                   m_macCode = macCode;
              public void setMacName(String macName) {
                   m_macName = macName;
              public void setMacIP(String macIP) {
                   m_macIP = macIP;
              public void setMacOS(String macOS) {
                   m_macOS = macOS;
              public void setMacDomain(String macDomain) {
                   m_macDomain = macDomain;

    Now the table is not displayed.
    import java.util.List;
    import java.util.Vector;
    import java.util.ArrayList;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import javax.swing.table.AbstractTableModel;
    public class TableWithVectorData extends JFrame {
         private JTable table;
         private Model model;
         public static void main(String[] arg) {
              JFrame.setDefaultLookAndFeelDecorated(true);
              TableWithVectorData app = new TableWithVectorData();
              app.setSize(new Dimension(600, 300));
              app.setVisible(true);
              app.validate();
         public TableWithVectorData() {
              super("Walter's Table Demo");
              model = new Model();
              table = new JTable(model);
              table.setPreferredScrollableViewportSize(new Dimension(500,200));
              JScrollPane scrollPane = new JScrollPane(table);
              add(scrollPane);
         public class Model extends AbstractTableModel {
              public static final int MAC_CODE_COL = 0;
              public static final int MAC_NAME_COL = 1;
              public static final int IP_COL = 2;
              public static final int OS_COL = 3;
              public static final int DOMAIN_COL = 4;
              public List<String> colNames = new ArrayList<String>();
              public List<Class> colTypes = new ArrayList<Class>();
              public List<MachineData> data = new Vector<MachineData>();
              public void Model() {
                   colNames.add("Machine Code");
                   colNames.add("Machine Name");
                   colNames.add("IP Address");
                   colNames.add("Operating System");
                   colNames.add("Domain");
                   colTypes.add(Integer.class);
                   colTypes.add(String.class);
                   colTypes.add(String.class);
                   colTypes.add(String.class);
                   colTypes.add(String.class);
                   data.add(new MachineData(new Integer(100), "Robert", "288.209.140.223", "Win NT",
    "Engineering"));
                   data.add(new MachineData(new Integer(105), "Rahul", "288.209.140.214","Solaris
    5", "Engineering"));
                   data.add(new MachineData(new Integer(110), "Daina", "288.209.140.220","HP UX",
    "Engineering"));
              public int getColumnCount() {
                   return colNames.size();
              public int getRowCount() {
                   return data.size();
              public void setValueAt(Object value, int row, int col) {
                   MachineData mD = (MachineData) data.get(row);
                   switch(col) {
                        case MAC_CODE_COL : mD.setMacCode((Integer) value);
                             break;
                        case MAC_NAME_COL : mD.setMacName((String) value);
                             break;
                        case IP_COL : mD.setMacIP((String) value);
                             break;
                        case OS_COL : mD.setMacOS((String) value);
                             break;
                        case DOMAIN_COL : mD.setMacDomain((String) value);
                             break;
              public String getColumnName(int col) {
                   return colNames.get(col);
              public Class getColumnClass(int col) {
                   return colTypes.get(col);
              public Object getValueAt(int row, int col) {
                   MachineData mD = (MachineData) data.get(row);
                   switch(col) {
                        case MAC_CODE_COL : return mD.getMacCode();
                        case MAC_NAME_COL : return mD.getMacName();
                        case IP_COL : return mD.getMacIP();
                        case OS_COL : return mD.getMacOS();
                        case DOMAIN_COL : return mD.getMacDomain();
                   return new String();
         public class MachineData {
              private Integer m_macCode;
              private String m_macName;
              private String m_macIP;
              private String m_macOS;
              private String m_macDomain;
              public MachineData() {
              public MachineData (Integer macCode, String macName, String macIP, String macOS, String
    macDomain) {
                   m_macCode = macCode;
                   m_macName = macName;
                   m_macIP = macIP;
                   m_macOS = macOS;
                   m_macDomain = macDomain;
              public Integer getMacCode() {
                   return m_macCode;
              public String getMacName() {
                   return m_macName;
              public String getMacIP() {
                   return m_macIP;
              public String getMacOS() {
                   return m_macOS;
              public String getMacDomain() {
                   return m_macDomain;
              public void setMacCode(Integer macCode) {
                   m_macCode = macCode;
              public void setMacName(String macName) {
                   m_macName = macName;
              public void setMacIP(String macIP) {
                   m_macIP = macIP;
              public void setMacOS(String macOS) {
                   m_macOS = macOS;
              public void setMacDomain(String macDomain) {
                   m_macDomain = macDomain;
    }

  • I'm lost--indentifier expected error

    Hey all,
    I'm trying to write a program that calculates a mortgage and gives the user the option of choosing from 3 loan terms: 7 years @ 5.35, 15 yrs @5.5% and 30 yrs @ 5.75%. For the options I decided to use radio buttons. I have used buttongroup but I think this is not working for me. I don't understand why as I have followed examples I've seen. Here is my error and my code. Please help.
    ----jGRASP exec: javac -g A:\MortgageCalculatorV2.java
    MortgageCalculatorV2.java:42: <identifier> expected
         bg.add(sevenYr);//add to buttongroup
    ^
    MortgageCalculatorV2.java:43: <identifier> expected
         bg.add(fifteenYr);//add to buttongroup
    ^
    MortgageCalculatorV2.java:44: <identifier> expected
         bg.add(thirtyYr);//add to buttongroup
    ^
    MortgageCalculatorV2.java:49: <identifier> expected
         sevenYr.setSelected(true);
    CODE:
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import java.lang.Math.*;//needed for calculation
    import java.text.*;//DecimalFormat class
    public class MortgageCalculatorV2 extends JFrame implements ActionListener //ActionListener is for the program to "hear" events
         //Create Labels, Text Boxes, Panels & Buttons
         JPanel row1 = new JPanel();//Panel for instructions
         JLabel lblInstruction = new JLabel("Please select your prefered mortgage terms: ");
         JPanel row2 = new JPanel();
         JRadioButton sevenYr = new JRadioButton("7 years at 5.35% ");
         JRadioButton fifteenYr = new JRadioButton("15 years at 5.5% ");
         JRadioButton thirtyYr = new JRadioButton("30 years at 5.75% ");
         ButtonGroup bg = new ButtonGroup();//group button options
         bg.add(sevenYr);//add to buttongroup
         bg.add(fifteenYr);//add to buttongroup
         bg.add(thirtyYr);//add to buttongroup
         sevenYr.setSelected(true);
         JPanel row3 = new JPanel();//this panel contains the components for the term
         //create result textbox
         JTextArea result = new JTextArea();
         JPanel row4 = new JPanel(); //this panel holds the buttons to tell the program to calculate or reset the form
         JButton calculate = new JButton("Calculate");
         JButton reset = new JButton("Reset");
         JPanel row5 = new JPanel();//this panel area is to be used to display the results of calculation
         //Create Frame
         public MortgageCalculatorV2()
              super("Mortgage Caculator");//Name the window
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//closes window when the X is clicked
              GridLayout layout = new GridLayout(5, 1, 10, 10);//creates a grid of 5 rows (to hold the panels) and 1 column
              Container pane = getContentPane(); //Create container
              pane.setLayout(layout);//Add grid layout to the content pane
              //Inside the main grid there are other grids created in the 5 rows (panels)
              GridLayout layout1 = new GridLayout(1, 1, 10, 10);
              row1.setLayout(layout1);//adds grid to the panel 1
              row1.add(lblInstruction);//adds component to the first panel
              pane.add(row1);//adds row1(panel) to the content pane
              GridLayout layout2 = new GridLayout(1, 1, 10, 10);
              row2.setLayout(layout2);
              row2.add(sevenYr);
              row2.add(fifteenYr);
              row2.add(thirtyYr);
              pane.add(row2);
              GridLayout layout3 = new GridLayout(1, 1, 10, 10);
              row3.setLayout(layout3);
              //for result textbox
              row3.add(result);
              pane.add(row3);
              GridLayout layout4 = new GridLayout(1, 2, 10, 10);
              row4.setLayout(layout4);
              row4.add(calculate);
              row4.add(reset);
              pane.add(row4);
              //Add Listeners for buttons
              calculate.addActionListener(this);
              reset.addActionListener(this);
              FlowLayout layout5 = new FlowLayout(FlowLayout.CENTER,10, 10);
              row5.setLayout(layout5);
              //row5.add(lblResult);
              pane.add(row5);
              pack();//Adjust windows to a prefered size for the components it holds
              setVisible(true);//makes the window visible
         }//end public
         public void actionPerformed(ActionEvent evt)
    //          if (evt.getSource() == calculate)//In the event if calculate button is clicked everything in calculateMort(); is executed     
    //               selected = bg.getSelectedItem();
    //               calculateMort();
    //          else if (evt.getSource() == reset)//or if reset is clicked everything in resetMorth(); is executed
    //               resetMort();
              else (bg.getSelectedItem() == thirtyYr)
                   thi
         }//end action performed
         void calculateMort()
              //Obtain variables. Declare & initialize variables
              int term[] = {7, 15, 30};
              double intRate[] = {5.35, 5.5, 5.75};
              double amount = 200000;
              double monthlyInterest = 0, payment = 0;
              //prepare formatting for output
              DecimalFormat money = new DecimalFormat ("$###,##0.00");//used to format the payment variable
              //monthlyInterest = intRate/(12 * 100);
              //payment = (amount * monthlyInterest) / (1 - Math.pow(1/ (1 + monthlyInterest), term * 12));//monthly payment is calculated
         //     lblResult.setText("Monthly payment is: " + money.format(payment));//results of calculation are displayed in the last panel
              //with proper formatting of output.
         void resetMort()//this is what happens after reset button is clicked--form is cleared
              //txtAmount.setText(null);
         //     txtIntRate.setText(null);
         //     txtTerm.setText(null);
         //     lblResult.setText(null);
         public static void main(String[] args)
              MortgageCalculatorV2 mort1 = new MortgageCalculatorV2();
         }//end public main
    }//end class MortgageCalculator
    PS: I know there are more errors down further in the code. I was trying to work on that part of my program after getting stuck with the buttongroup problem I'm facing. I have commented out a bit the code here for now until my problem is fixed.

    You are awesome. Thank you :) I had no clue it had
    to be inside a method. I thought the place for that
    button group would be right after creating the radio
    buttons.Right inside the class's braces all you can do is declare things. There are no other statements than declarations allowed.
    BTW, I'm doing this for my online class. I had
    asked the teacher but I was still stuck as her
    response was a link to a site. Thanks!Judging by the qulity of some teachers that are reflected by the knowledge of their pupils (not you, but others), I guess I should start teaching Java myself as everbody seems to be allowed to do it.

  • Write permissions issues / lots of "ACL found but not expected" errors / hardware failure? on brand new Mac Mini (still within warranty). OSX Mavericks 10.9.1.

    I was hoping that I could receive some feedback from you fine folks here
    My situation:
    I bought a 2012 Mac Mini 2.6 Ghz Intel Core i7 from the online Apple store. It came with Mavericks 10.9.1 pre-installed and was delivered two days ago (I know, the mini update is evident but I needed the machine).
    I noticed that I had to enter my password every time I created, moved or deleted a folder. I did not think much of it.
    I did, however, think much of not being able to install files from certain developers. I received the "The installer is damaged" notification as shown in this topic: https://discussions.apple.com/thread/5541793
    This screenshot is someone elses, I tried to install audio software.
    Based on that error, I contacted the developer of the software. But then I noticed that I got the same error for other developers too.
    I tried the solution that the topic starter marked as solving his issue in https://discussions.apple.com/thread/5541793. It involves booting in OSX Recovery (command+R) and excecuting the 'resetpassword' command. That did not work for me. It also looks like my password data isn't stored as I do not see the 'obfuscated' password dots that the screenshot shows in that topic, even when I entered and saved it multiple times -- but I'm not sure if that is part of the main issue (which I'm gettting to).
    I also made sure gatekeeper allows applications to be installed from unidentified developers, as shown here: http://www.instantteamspeak.com/static/en/img/mac-gatekeeper-anywhere.png That didn't help either.
    Next I opened up Disk Utility and ran a check on write permissions. That got me worried.
    The check ran for a long time, spitting out "ACL found but not expected" errors.
    I proceeded to restore write permissions. That took 20-25 minutes.
    Once it finished I checked write permissions again. An equal amount of permissions needed to be restored! It's as if Mavericks didn't remember anything it did.
    The good news is that I could now install the files I previously couldn't, but the fact that I've restored write permissions three times now, and each time it seems as if nothing of that is remembered, has gotten me worried.
    I've made a video with some explanation here http://youtu.be/a0hKQvy-Km8 - my sincerest apologies for the shaky camera.
    I then checked the hard disk and the partition above it. The Macintosh HD gave me the green 'ok' light, but something weird happened when I checked the partition on the level above it. It will take ages to finish and I see Disk Utility doing some strange 'jumping around': http://youtu.be/hyLAEhLRnKc (warning - long video so you might want to skip through it. The point is to demonstrate how long it takes).
    When I checked the hard disk for a second and third time, I got 'everything ok' results pretty quickly.
    Checking both the HD and the partition above it again, this is what happens (and what now worries me the most): http://youtu.be/4l2Fb2RvOW4
    Edit: I sum up my findings at the end of the video, might be better to skip here and then watch the full thing only if it's not clear yet.
    There is some further explanation in the video. It basically comes down to Disk Utility not finishing/not providing any conslusion, while Activity Monitor shows it's not doing anything -- please bare with me when watching the video, I know it's not the most exhiting video ever posted on YouTube but it does bring my point across (there is some more talk in this one; not sure if that's an improvement in terms of entertainment value though ).
    ** Is my hard disk failing? In that case I'll return the Mac immediately.
    ** Or just a software issue?
    As said, this Mac Mini is brand new. If at some stage anyone would feel the wise thing to do is to return my Mac, please do let me know. There is a 14 day return policy in The Netherlands (on top of other warranties) and I'd rather return it in case of doubt, than end up with technical issues with this machine once I've started working with it. I'm ok with doing some troubleshooting if the machine is fine, but I'd rather not take a gamble with a 1200 € machine under warranty.
    Thank you so much in advance - your help is highly appreciated. 
    Paul

    I was hoping that I could receive some feedback from you fine folks here
    My situation:
    I bought a 2012 Mac Mini 2.6 Ghz Intel Core i7 from the online Apple store. It came with Mavericks 10.9.1 pre-installed and was delivered two days ago (I know, the mini update is evident but I needed the machine).
    I noticed that I had to enter my password every time I created, moved or deleted a folder. I did not think much of it.
    I did, however, think much of not being able to install files from certain developers. I received the "The installer is damaged" notification as shown in this topic: https://discussions.apple.com/thread/5541793
    This screenshot is someone elses, I tried to install audio software.
    Based on that error, I contacted the developer of the software. But then I noticed that I got the same error for other developers too.
    I tried the solution that the topic starter marked as solving his issue in https://discussions.apple.com/thread/5541793. It involves booting in OSX Recovery (command+R) and excecuting the 'resetpassword' command. That did not work for me. It also looks like my password data isn't stored as I do not see the 'obfuscated' password dots that the screenshot shows in that topic, even when I entered and saved it multiple times -- but I'm not sure if that is part of the main issue (which I'm gettting to).
    I also made sure gatekeeper allows applications to be installed from unidentified developers, as shown here: http://www.instantteamspeak.com/static/en/img/mac-gatekeeper-anywhere.png That didn't help either.
    Next I opened up Disk Utility and ran a check on write permissions. That got me worried.
    The check ran for a long time, spitting out "ACL found but not expected" errors.
    I proceeded to restore write permissions. That took 20-25 minutes.
    Once it finished I checked write permissions again. An equal amount of permissions needed to be restored! It's as if Mavericks didn't remember anything it did.
    The good news is that I could now install the files I previously couldn't, but the fact that I've restored write permissions three times now, and each time it seems as if nothing of that is remembered, has gotten me worried.
    I've made a video with some explanation here http://youtu.be/a0hKQvy-Km8 - my sincerest apologies for the shaky camera.
    I then checked the hard disk and the partition above it. The Macintosh HD gave me the green 'ok' light, but something weird happened when I checked the partition on the level above it. It will take ages to finish and I see Disk Utility doing some strange 'jumping around': http://youtu.be/hyLAEhLRnKc (warning - long video so you might want to skip through it. The point is to demonstrate how long it takes).
    When I checked the hard disk for a second and third time, I got 'everything ok' results pretty quickly.
    Checking both the HD and the partition above it again, this is what happens (and what now worries me the most): http://youtu.be/4l2Fb2RvOW4
    Edit: I sum up my findings at the end of the video, might be better to skip here and then watch the full thing only if it's not clear yet.
    There is some further explanation in the video. It basically comes down to Disk Utility not finishing/not providing any conslusion, while Activity Monitor shows it's not doing anything -- please bare with me when watching the video, I know it's not the most exhiting video ever posted on YouTube but it does bring my point across (there is some more talk in this one; not sure if that's an improvement in terms of entertainment value though ).
    ** Is my hard disk failing? In that case I'll return the Mac immediately.
    ** Or just a software issue?
    As said, this Mac Mini is brand new. If at some stage anyone would feel the wise thing to do is to return my Mac, please do let me know. There is a 14 day return policy in The Netherlands (on top of other warranties) and I'd rather return it in case of doubt, than end up with technical issues with this machine once I've started working with it. I'm ok with doing some troubleshooting if the machine is fine, but I'd rather not take a gamble with a 1200 € machine under warranty.
    Thank you so much in advance - your help is highly appreciated. 
    Paul

  • I would like to know that my lightroom 5 has suddenly stopped working... whenever i am launching it it is showing that lightroom has ecncountered a problem in reading the photos from its cache..plzz help me to slove this problm... as soon as possible..

    it is shwing that it has ebcountered an eror from reading from its preview cache and needs to qiut...
    after re-instalation also it i still showing the same thing... plzz help me.

    That error message indicates that your preview cache files have become corrupt. This is not a critical problem to solve. Just delete the previews file it carries the same name as your catalog file with the extension ending "Previews.LRDATA" see the screen capture. Delete this file and when you next restart Lightroom it will rebuild the previews.
    The link below will let you know where the file is located.
    Preference and other file locations | Lightroom 4

  • "  ')' expected error..........

    i have defined a function, and the compiler is giving me "')' expected " error...
    here is my code
    package ab;
    import java.io.*;
    import java.util.*;
    import com.db4o.Db4o;
    import com.db4o.ObjectContainer;
    import com.db4o.ObjectSet;
    public class Test3 extends Util {
      public static void main(String[] args) {
         ObjectContainer db=Db4o.openFile(Util.DB4OFILENAME);
        try {
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));//USER INPUT KEYWORDS
              String the_query = in.readLine();     // READING KEYWORDS
         String[] arr = the_query.split (" ");     // SPLITTING USER KEYWORDS AND STORING IN ARRAY
              //****************************************************************************************ERROR LINE
               func(String p)                   
                       key ab = new key(arr[k]);
                        db.set(ab);
                        System.out.println(arr[k] + " is stored with 1st condition");
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
         // FETCHING DATA FROM DATABASE
         key proto = new key(null);
         ObjectSet result = db.get(proto);
         LinkedList ll2 = new LinkedList();
         while(result.hasNext()) {
         ll2.add(result.next());
         //System.out.println("retrieved linked list is" +ll2);
         String s = String.valueOf(ll2);
         int m = s.length()-2;
         String sub = s.substring(1,m);
         String [] str = sub.split(",");     // SPLITTING THE KEYWORDS
         int j = str.length;
         int g=0,h=0;
         String temp;
         h = str[0].indexOf('/');          // REMOVING THE "/" TO SEPERATE KEYWORD FROM HYPERLINK AND WEIGHT
         str[0]=str[0].substring(0,h);
         System.out.println("str[]0 is  "+ str[0]);
         for(int i=1; i<j;i++)
         g = str.indexOf('/');               // REMOVING THE "/" TO SEPERATE KEYWORD FROM HYPERLING AND WEIGHT
         str[i]=str[i].substring(1,g);
         System.out.println("str[]" i " is " + str[i]);
    //STORING DATA INTO DATABASE
    int l=0;
    int t = arr.length;
    System.out.println("arr[] length is " + t);
    System.out.println("str[] length is j" + j);
    for (int k=0; k < t; k++)
         {     l=0;
              for(l=0;l<=j;l++)
                   key(arr[k]);
              if(l+1> j)          // CHECKING IF AT THE END OF ARRAY
                        key ab = new key(arr[k]);
                        db.set(ab);
                        System.out.println(arr[k] + " is stored with 1st condition");
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
              else if((arr[k].equals(str[l]))) {          // CHECKING IF THE TWO STRINGS MATCHES OR NOT
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
                        System.out.println("Comparing " + arr[k] + "//////////" + str[l]);
                        System.out.println(arr[k]+ " STRING ALREADY PRESENT");
                        System.out.println(" 3rd condition");
                        k++;
                        l= -1;
                        System.out.println("due to 3rd condition now arr [k] is" + k+ " str[l] is" + l);
                   else          // NOT DOING ANYTHING
                        System.out.println("not doing anything");
                        System.out.println("arr [k] is" + k+ " str[l] is" + l);
                        System.out.println("Comparing " + arr[k] + "//////////" + str[l]);
              /* BufferedReader in2 = new BufferedReader(new InputStreamReader(System.in));//USER INPUT HYPERLINK
    BufferedReader in3 = new BufferedReader(new InputStreamReader(System.in));//USER INPUT WEIGHT
                   String hyp = in.readLine();     // READING HYPERLINKS
              String weight1 = in.readLine(); //READING WEIGHT
              int weight = Integer.parseInt(weight1);
              for(int c=0;c<t;c++)
              hyp h1 = new hyp(arr[c],weight);
                   ab.sethyper(h1);
                   db.set(ab);
    in.close();
    //in2.close();
    //in3.close();
    } catch (IOException ioe)
    { ioe.printStackTrace();
         db.close(); }
    and the error is .....C:\Documents and Settings\Sumit\Desktop>javac ab/Test3.java
    ab/Test3.java:22: ')' expected
    func(String p)
    ^
    1 error

    cotton.m wrote:
    cotton.m wrote:
    ping.sumit wrote:
    thanks abillcons!.... i got itGot what exactly?
    Because that won't fix the multitude of problems you have that I listed...Because to be honest with you ping it's pretty annoying that I took the time to look at your code in depth, which Bill
    did not do, and list all the problems you have there and you just want to pretend that adding a return type to a
    method signature in the middle of another method fixes this problem. Certainly a missing return type is a problem in
    a method signature, but when the "method" in question is in the midst of another method and uses variables local
    to the other method, never mind a slew of other variables that are never declared anywhere... well it's not really the
    only problem and certainly fixing it did not make you "get" it. Whatever "it" may be.
    What a waste of time it was helping you. I won't make that mistake again to be sure.Yes you did do more work than I. But I answered his direct and immediate question. I had no intention of stopping there if and when the pgm still did not work. I answered the immediate question, then others went on to add greater depth. It's always a disappointment when one does not seem to receive due credit - and we've all been there. Thats partly why I tried to bring the OP's attention back to my post as well, because it seemed that's what was occurring there too.
    But I also see that many times folks get stuck on a point they are trying to solve and become frustrated to the point of distraction at times - so I think it's best to cut them some slack.
    There has been a real rash of posters that don't come through either with dukes, thanks or even acknowledgments lately ... I hope this OP will not be one of them - I don't see that that is the case thus far.

  • Unable to create timer - identifier expected? Why?

    Hi all,
    Given this code excerpt:
    private Timer mytimer;
    ActionListener taskPerformer = new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    //...Perform a task...
    mytimer = new javax.swing.Timer(progress_bar_refresh_delay,taskPerformer);
    Why does the compiler stop at the above line:
    TestFTPApplet.java:128: <identifier> expected
    mytimer = new javax.swing.Timer(2000,taskPerformer);
    ^
    1 error
    What identifier? What does it expect? I've tried everything I can think of but the compiler absolutely refuses to comple the above code. As far as I can determine, mytimer is not a reserved word or object reference - I've tried several different names but the compiler keeps stopping at the above line, saying <identifier> expected.
    The fact that an identifier is expected is non-sensical - what identifier? What am I doing wrong?
    -What- is expected? An Object reference? An abstract object?
    Thanks...

    What am I doing wrong?If that code appears outside of any method, no statements or expressions
    are allowed; just initializations and definitions, that's why the compiler
    is whining. Your code looks like this:T1 foo;
    T2 bar= <initialization>;
    foo= <some value>;You can't assign a value to a variable there. Either change it to this:T1 foo= <some value>;
    T2 bar= <initialization>;... or assign <some value> to foo in the constructor or another method.
    kind regards,
    Jos

Maybe you are looking for

  • PA30 - is not working in Russia

    Hi All, when we are trying to  change or display  Russian employees in PA30, we are getting below error message in our EHP7 test system.  Please advice. 'Debe introducir un número de personal real' Thanks Jay

  • File cannot be opened because there are no pages - Reader 9 & X

    I have an old hydro bill in PDF format from 2000.  I can open this PDF in Adobe Reader 8 and earlier with no issues whatsoever (i.e. double-clicking the PDF in Windows Explorer).  The problem started with Adobe 9 & continues with Adobe X.  When I dou

  • What to add on?

    I am ready to purchase a MBA and do not want to overbuy unneeded add-ons.  I am retired and will use the computer only for the basics outside of a lot of writing.  What to add on and what to avoid?

  • Pls advice on  this select statment...

    HI, I want to display the fields in tcode xd02 with sort functionality with fields kunnr                     kna1 table name1                     kna1 SMTP_ADDR         email id from      table ADR6 my question is on mapping from kna1 we can get fiel

  • How do I take an attachment from an emailke an attachment

    How do I take a PDF email attachment and send it to Adobe so I can fill in blanks on the attachment?