Is it possible to compile Swift for OS X 10.5?

Can not figure out/compile my Java code..........?

  • */ import java.awt.*; import java.awt.event.*; import java.util.*; import java.text.*; import javax.swing.*; import javax.swing.text.*; public class MyfileJan extends JFrame implements ActionListener { //Build the JLabels and JTextFields, and the JComboBox JLabel codeJL=new JLabel("Code #:"); JComboBox codeJC=new JComboBox(); JLabel nameJL=new JLabel("Description:"); JTextField nameJT=new JTextField(12); JLabel priceJL=new JLabel("Cost:"); JTextField priceJT= new JTextField(12); JButton enterJB=new JButton("Enter"); JButton totalJB=new JButton("Total"); JLabel subtotalJL=new JLabel("Subtotal:"); JTextField subtotalJT=new JTextField(12); JLabel taxJL=new JLabel("Tax:"); JTextField taxJT=new JTextField(12); JLabel totalJL=new JLabel("Total:"); JTextField totalJT= new JTextField(12); JButton showRcptJB = new JButton("Show Receipt"); JTextPane pane=new JTextPane(); //private subTotal will store a running total private double subTotal=0; NumberFormat myFormatter= NumberFormat.getCurrencyInstance(Locale.… a decimal format object //construct an instance of MyfileJan public MyfileJan() { ;//puts a label on the gui } //create 3 arrays to hold the values of the items in stock, These arrays will store the receipt items and data String[] codeArray= {"105","110","120","160","200"}; String[] nameArray= {"doc1","doc2","doc3","doc4","doc5"}; String[] priceArray={"100.00","200.00","300.00","… String[] codeRcptArray={"________________"}; String[] nameRcptArray={"________________"}; String[] priceRcptArray={"________________"}; } //add items to editable text, and add an actionListener import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.*; public class SimpleWindow implements ActionListener { JFrame f; JPanel p; JLabel 1itemCode, 1itemCode, 1itemCode, 1itemCode, 1itemCode; JTextField t105, t110, t120, t160, t200; JButton b1, b2; public SimpleWindow() { f = new JFrame(""); f.setDefaultCloseOperation(JFrame.EXI… p = new JPanel(); p.setLayout(new GridLayout(4,2)); litemCode = new JLabel("105"); 1itemCode = new JLabel("110"); litemCode = new JLabel("120"); litemCode = new JLabel("160"); 1itemCode = new JLabel("200"); tdoc1 = new JTextField(15); tdoc2 = new JTextField(5); tdoc3 = new JTextField(20); tdoc4 = new JTextField(15); tdoc5 = new JTextField(5); b1 = new JButton("OK"); b1.addActionListener(this); b2 = new JButton("Clear"); b2.addActionListener(this); f.getContentPane().add(p); f.setSize(600, 200); f.setVisible(true); } public static void main(String args[]) { SimpleWindow w = new SimpleWindow(); } public void actionPerformed(ActionEvent e) { if (e.getSource() == b1) { String name = tName.getText(); String age = tAge.getText(); String address = tAddress.getText(); String str = "Name: "+name+"\nAge: "+age+"\nAddress: "+address; JOptionPane.showMessageDialog(f,str); } if (e.getSource() == b2) { tName.setText(""); tAge.setText(""); tAddress.setText(""); } } } //build contentPane public Container buildPane() { // add items to the combo box, and add an actionListener codeJC.addItem("105"); codeJC.addItem("110"); codeJC.addItem("120"); codeJC.addItem("160"); codeJC.addItem("200"); codeJC.addActionListener(this); codeJC.setToolTipText("select an item, then press enter to display description and cost"); //build the firstJPanel JPanel firstJPanel = new JPanel(); firstJPanel.add(codeJL); firstJPanel.add(codeJC); firstJPanel.add(nameJL); firstJPanel.add(nameJT); firstJPanel.add(priceJL); firstJPanel.add(priceJT); nameJT.setEditable(false); priceJT.setEditable(false); firstJPanel.setLayout(new GridLayout(3,2,4,4)); //build the middlePanel JPanel middlePanel=new JPanel(); //create the JTextPlane for the middlePanel setTabsAndStyles(pane); JScrollPane sp=new JScrollPane(pane); sp.setVerticalScrollBarPolicy(JScrol… sp.setPreferredSize(new Dimension(550, 250)); middlePanel.add(sp);//add the scroll pane to the middlePanel //add the enter, total, and show receipt buttons to the middlePanel middlePanel.add(enterJB); middlePanel.add(totalJB); middlePanel.add(showRcptJB); middlePanel.setLayout(new FlowLayout()); //build the secondJPanel JPanel secondJPanel=new JPanel(); secondJPanel.add(subtotalJL); secondJPanel.add(subtotalJT); secondJPanel.add(taxJL); secondJPanel.add(taxJT); secondJPanel.add(totalJL); secondJPanel.add(totalJT); subtotalJT.setEditable(false); taxJT.setEditable(false); totalJT.setEditable(false); secondJPanel.setLayout(new GridLayout(3,2,4,4)); //Build a container to add the first, middle and second jpanels

  • Answer:

    What's the error that it's throwing?

Orion at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.