Fed up! dont know whats wrong with this code

import java.io.*;
import java.net.*;
import java.awt.*;
public class machine {
     private String machine_name;
     private String IP_address;
     public static void main(String[] args) throws IOException {
               machine server = new machine();
               server.machine_name = "SERVER1";
               server.IP_address   = "192.168.0.1";
               InputStreamReader reads_incoming = null;
               // Reads incoming Bytes
               PrintWriter sends_outgoing = null;
               Socket ping_socket         = null;
               try{
                    ping_socket = new Socket(server.machine_name , 7);
                    sends_outgoing = new PrintWriter(ping_socket.getOutputStream(),true);
                    reads_incoming = new InputStreamReader(ping_socket.getInputStream());
               catch (UnknownHostException e){
                    //report error to sole text box
               catch (IOException e)
                    //similar
               /* Need a string to send some arbitrary bytes to SERVER1
                * using IP_address instead , as this field in this implementation
               while(true)
                    sends_outgoing.println(server.IP_address);
                    if(ping_socket.getInputStream() != null)
                         System.out.print("Server is up");
}

same... i am not very experienced, and try and uses this as training... but as new to java programming i could still mention about 5 things that might be wrong with this code... so a deeper explanation would be nice...
while(true) { } for example seems like a nice way to make infinite loop that can suck your memory out of your computer pretty fast :-) newb

Similar Messages

  • Does ANYONE know whats wrong with this program?!?!

    Hey(again),
    Does anyone know whats wrong with this program?:
    public class FloatingNumbersTest
    public static void main(String args[])
    float float1 =50.0f;
    float closeFloat=0.001f
    float farfloat=100.0f
    if (float1<=closeFloat)
    System.out.print("Float1 pretty close to zero");
    if (float1>=closeFloat)
    System.out.print("Float1 is near 0");
    if (float1>=farfloat)
    System.out.print("Float1 is not even close to zero!"0
    }There has seemed to be 5 errors!

    public class FloatingNumbersTest
    public static void main(String args[])
    float float1 =50.0f;
    float closeFloat=0.001f
    float farfloat=100.0f
    if (float1<=closeFloat)
    HERE        System.out.print("Float1 pretty close to zero");
    if (float1>=closeFloat)
    System.out.print("Float1 is near 0");
    if (float1>=farfloat)
    System.out.print("Float1 is not even close to zero!"0
    }you're missing the opening { for the first if.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • My iphone isnt turning on or charging i dont know whats wrong with it, can anyone help me?!?!

    i dont know whats wrong with my iphone it wont turn on or charge i dont now what i did wrong please help

    Charge for 15 minutes with the wall or mains adapter. Then hold the HOME and SLEEP buttons until an Apple logo appears. If something other than an Apple logo appears follow the instructions on the screen. If nothing happens after holding for 30 seconds you have a hardware problem.

  • Contest: Guess whats wrong with this code!

    Can you guess whats wrong with this code snippet? Perhaps its too easy...
    private void clearDefaultTableModel( DefaultTableModel dtm) {    
            int  rowCount  = dtm.getRowCount();
            for(int i =0;  i < rowCount; i++) {
                dtm.removeRow(i);  
        }- Karl XII

    Can you guess whats wrong with this code snippet?
    Perhaps its too easy...
    private void clearDefaultTableModel(
    DefaultTableModel dtm) {    
    int  rowCount  = dtm.getRowCount();
    for(int i =0;  i < rowCount; i++) {
    dtm.removeRow(i);  
    it should be
    private void clearDefaultTableModel(DefaultTableModel dtm) {    
       int  rowCount  = dtm.getRowCount();
       for(int i =0;  i < rowCount; i++) {
         dtm.removeRow(0);  
    }or another way
    private void clearDefaultTableModel(DefaultTableModel dtm) {    
      while(dtm.getRowCount()>0){
         dtm.removeRow(0);  

  • HELP PLEASE - WHATS WRONG WITH THIS CODE

    Hi. I get this message coming up when I try to compile the code,
    run:
    java.lang.NullPointerException
    at sumcalculator.SumNumbers.<init>(SumNumbers.java:34)
    at sumcalculator.SumNumbers.main(SumNumbers.java:93)
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    I am not sure whats wrong with the code. Any assistance would be nice. The code is below.
    package sumcalculator;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SumNumbers extends JFrame implements FocusListener {
    JTextField value1;
    JTextField value2;
    JLabel equals;
    JTextField sum;
    JButton add;
    JButton minus;
    JButton divide;
    JButton multiply;
    JLabel operation;
    public SumNumbers() {
    SumNumbersLayout customLayout = new SumNumbersLayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    value1.addFocusListener(this);
    value2.addFocusListener(this);
    sum.setEditable(true);
    value1 = new JTextField("");
    getContentPane().add(value1);
    value2 = new JTextField("");
    getContentPane().add(value2);
    equals = new JLabel("label_1");
    getContentPane().add(equals);
    sum = new JTextField("");
    getContentPane().add(sum);
    add = new JButton("+");
    getContentPane().add(add);
    minus = new JButton("-");
    getContentPane().add(minus);
    divide = new JButton("/");
    getContentPane().add(divide);
    multiply = new JButton("*");
    getContentPane().add(multiply);
    operation = new JLabel();
    getContentPane().add(operation);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public void focusGained(FocusEvent event){
    try {
    float total = Float.parseFloat(value1.getText()) +
    Float.parseFloat(value2.getText());
    sum.setText("" + total);
    } catch (NumberFormatException nfe) {
    value1.setText("0");
    value2.setText("0");
    sum.setText("0");
    public void focusLost(FocusEvent event){
    focusGained(event);
    public static void main(String args[]) {
    SumNumbers window = new SumNumbers();
    window.setTitle("SumNumbers");
    window.pack();
    window.show();
    class SumNumbersLayout implements LayoutManager {
    public SumNumbersLayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 711 + insets.left + insets.right;
    dim.height = 240 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+48,128,40);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+48,128,40);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+408,insets.top+48,56,40);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+48,152,40);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+136,72,40);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+248,insets.top+136,72,40);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+368,insets.top+136,72,40);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+136,72,40);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+176,insets.top+48,56,40);}
    }

    Thank you. How do i amend this? I have defined value1though.Yes, you did - but after the call to addFocusListener(...). It needs to be before it.
    BTW, you did the same thing with "value2.addFocusListener(this)" and "sum.setEditable(true)" on the next two lines. You're attempting to call a method on an object that doesn't exist yet (i.e., you haven't called new yet).

  • Whats Wrong with this code? URLReader

    Ok, so I have this URLReader.java program. It goes to a specific website, I put in a project ID. It pulls up a project. I can then "Scrape", "Extract Data from the URL and put them into variables. I then upload the variables into the DB.
    I've used this code over and over again and it works, but I seem to have a problem with the second part of the code.The error message that I get is:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
    Please note the URL is a fake one. I did not want to give the real URL. I have provided the String to read, which is actually HTML code. I thought it might be the "Researchers(s):" string that it does like, maybe a problem with "(s), but I dont know?
    First part of the code: This really gets a project ID from a collection and iterates throught the collection with each project ID.
    String projectId = "87023";
                java.net.URL projectDetails = new  java.net.URL("http://someSite.com/portfolio/ProjectDetails.asp?Source=Tracking&Key="+projectId);
                java.io.BufferedReader in =
                            new java.io.BufferedReader(new java.io.InputStreamReader(projectDetails.openStream()));
                String projDetailspage = new String("");
                String inputLine = "";
                while ((inputLine = in.readLine()) != null)
                    projDetailspage = projDetailspage.concat(inputLine.trim());
                System.out.println("project ID: "+ projectId);
    Second Part of the Code:
    String str = (projDetailspage.split("\\<[Bb]\\>Researcher(s)\\</[Bb]\\>")  //  look for: <b>Researcher(s):</b> , also the part of code I am having problems with.
                [1].split( "\\<td\\>")[1].split("\\</table>")[0].trim());   //put everything into a variable call str from the <td> to the </table> tags 
                System.out.println("String before replace all: "+ str);
    The HTML code to read and search through:<!-- researchers -->
        <tr>
              <td width="30%" align="right" valign="top">
                   <font size="-1">
                   <b>Researcher(s):</b>
                   </font>
              </td>
                  <td width="70%" align="left" valign="top">
                        <font size="-1">
                        Dr. Michael E. Welge, University of Illinois at Urbana-Champaign
                        </font>
                   </td>
                   </tr>
                            <tr>
                                  <td width="30%">
                                       <font size="-1">
                                       </font>
                                  </td>
                                <td width="70%" align="left" valign="top">
                                       <font size="-1">
                                       Dr. Albert J. Valocchi, University of Illinois at Urbana-Champaign
                                       </font>
                                  </td>
                            </tr>
                            <tr>
                                  <td width="30%">
                                       <font size="-1">
                                       </font>
                                  </td>
                                <td width="70%" align="left" valign="top">
                                       <font size="-1">
                                       Dr. Barbara Ann Bailey, University of Illinois at Urbana-Champaign
                                       </font>
                                  </td>
                            </tr>
                            <tr>
                                  <td width="30%">
                                       <font size="-1">
                                       </font>
                                  </td>
                                <td width="70%" align="left" valign="top">
                                       <font size="-1">
                                       Dr. David E. Goldberg, University of Illinois at Urbana-Champaign
                                       </font>
                                  </td>
                            </tr>
         <!-- students -->
        <tr>
              <td width="30%" align="right" valign="top">
                   <font size="-1">
                   <b>Student(s):</b>
                   </font>
              </td>
                   <td width="70%" align="left" valign="top">
                        <font size="-1">
                        None Found
                        </font>
                   </td>
              </tr>
              </table>
              </td>
         </tr>
         </table>
         </td>
    </tr>
    </table>

    camickr
    I ran your program and it works great. This is the output I get. This is for a project that had 4 researchers, that is not always the case.
    investigator1 = r. Michael E. Welge
    investigator2 = Dr. Albert J. Valocchi
    investigator3 = Dr. Barbara Ann Bailey
    investigator4 = Dr. David E. Goldberg
    for some reason I loose the D in Dr. for the first Investigator.
    also, I know I need to modify my code to find out how many researchers there are. I then place them into the correct variable.
    example
    researchers String that your code works on: None Found</font></td></tr><!-- students --><tr><td width="30%" align="right" valign="top"><font size="-1"><b>Student(s):</b></font></td><td width="70%" align="left" valign="top"><font size="-1">Dr. Terry Hogan, Pennsylvania State University</font></td></tr><tr><td width="30%"><font size="-1"></font></td><td width="70%" align="left" valign="top"><font size="-1">Dr. Chengyu Shen, Pennsylvania State University</font></td></tr><tr><td width="30%"><font size="-1"></font></td><td width="70%" align="left" valign="top"><font size="-1">Dr. Anne Pifer, Pennsylvania State University</font></td></tr>
    investigator1 = one Found|Student(s):|Dr. Terry Hogan  // should be None Found.
    investigator2 = Dr. Chengyu Shen
    investigator3 = Dr. Anne Pifer
    npe errorjava.lang.ArrayIndexOutOfBoundsException: 3
    The logic should be, when I scrape between tags, if it should be "None Found" then skip to the next project ID , also, each project may have as many as 0, 1, 2, 3, 4 researchers. but no more than 4
    So I thought of doing an:
    If( researchers == 2)
        investigator1 = investigator[x];
        investigator2 = investigator[x];
    }etc...
    Thanks again.
    if you need me to email you the code. my email addres is [email protected]
    I know I am not that talented of a programmer, but I am learning, and trying all the time. I want to do this the correct way, but I am not always sure which way that is. I usually try a class Diagram and go from there, but I have had some trouble with this one. If you need more of an explanation then email me.
    orozcom

  • Whats  wrong with this code?

    Hi Experts,
    I am getting the error as " the method get_data has no returning parameter.
    Can someone please help me with this.
    CLASS main DEFINITION.
      PUBLIC SECTION.
        METHODS add_data IMPORTING i_data TYPE i.
        METHODS get_data EXPORTING e_data TYPE char20.
      PRIVATE SECTION.
        DATA attribute TYPE char01.
    ENDCLASS.
          CLASS main IMPLEMENTATION
    CLASS main IMPLEMENTATION.
      METHOD add_data.
        ADD i_data TO attribute.
      ENDMETHOD.
      METHOD get_data.
        CONCATENATE 'Attribute value' attribute
                                   INTO e_data SEPARATED BY space.
      ENDMETHOD.
    ENDCLASS.
    DATA: object_reference TYPE REF TO main.
    end-of-selection.
      CREATE OBJECT object_reference.
      DATA:
      var TYPE char20.
      CALL METHOD object_reference->add_data( i_data = 3 ).
    var = object_reference->get_data( ).  --> errored here
      WRITE var.

    Hi Dan, if you want to use a RETURNING parameter when you call you method, you need to define the parameter as a RETURNING parameter in your class definition.
        METHODS get_data RETURNING VALUE(e_data) TYPE char20.
    You had defined it as an EXPORTING parameter, which means that when you call the method you would have need to use this syntax instead.
       object_reference->get_data( IMPORTING e_data = var ).
    Regards,
    Rich Heilman

  • Please tell me whats wrong with this code for sendRedirect

    /**AckController.java**/
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import java.sql.*;
    import java.util.*;
    * @version      1.0
    * @author
    public class AckController extends HttpServlet {
         * @see javax.servlet.http.HttpServlet#void (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              System.out.println("in AckController.doGet():action: "+req.getParameter("action"));
              String viewName = "";
              viewName = "/TransportersLogin/jsp/dealerAck/DealerAddAck.jsp";
              req.setAttribute("temp","temp");
              System.out.println("1..in AckController.doGet():viewName: "+viewName);     
              resp.sendRedirect(viewName);
         * @see javax.servlet.http.HttpServlet#void (javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              doGet(req,resp);
    /*********end of servlet**********/
    /****DealerAddAck.jsp****/
    <%@ page session="true" language="java" %>
    <%@ page import="javax.servlet.*,javax.servlet.http.*,java.net.*"%>
    <%
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    <link rel="stylesheet" href="/TransportersLogin/theme/stylesecure.css">
    <%
         out.println("in jsp");
         out.println("in jsp: temp value: "+(String)request.getAttribute("temp"));
    %>
    <script>
    function consolidate()
         alert("wait");
         //document.forms[0].action = "DealerConfirmAck.html";
         //document.forms[0].submit();
    </script>
    </head>
    <body>
    <form name="frmaddclaim">
      <table border="0" cellpadding="3" cellspacing="1" width="100%">
      </table>
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr>
          <td class="TDHeader" height="18" colspan="2">Add Acknowledgement Receipt</td>
        </tr>
        <tr>
          <td class="TDcolorgreybold" height="18" align="left">
               Available Invoices
          </td>
        </tr>
      </table>
      <table width="100%" border="0" height="26" cellpadding="3" cellspacing="0">
        <tr>
          <td class="tdheader" colspan="2" height="22" align="right">
          <input type="button" value="Add Receipt" name="B3" onClick="javascript:consolidate();"></td>
        </tr>
      </table>
      <table width="100%" border="0" height="26" cellpadding="3" cellspacing="0" align="left">
        <tr>
          <td class="labeltextRed" height="18" align="left">Select an Invoice from the
          list and click "Add Receipt". </td>
        </tr>
      </table>
    </form>
    </body>
    </html>I am trying to set an attribute in the request object (attribute name is temp). But in the jsp it is not getting the value of the attribute. The request is not getting transferred. Please let me know what correction is needed.
    I have used RequestDispatcher as well but in that case the control doesnt go the jsp when i used sendRedirect the control goes only if there isnt any request.getattribute in the JSP page.
    Thanks
    Nikesh

    You can;t transfer the request object using response.sendRedirect;
    Use RequestDispatcher to transfer the request object into another page.
    For Example:
    RequestDispatcher dispatcher  = getServletContext().getRequestDispatcher(viewName);
                dispatcher.include(req, resp);

  • Can understand whats wrong with this code.

    I'm sort new to Java programing, and I created this simple converter, but when I try to complie it, it gives me an exception error, could some one tell me how to correct this code.
    import java.text.*;
    import javax.swing.*;
    public class Converter
         private final static double EURO = .8295577, YEN = 115.614, CAD = 1.17781;
         public static void main (String[] args)
               String input =null;
               double US= 0.0;
               DecimalFormat twoPrecision = new DecimalFormat("0.00");
             input() = 0
              try{
                   US = Double.parseDouble (input);
                    System.out.print("US to Euro: ");
                    System.out.println(twoPrecision.format(US * EURO));
                  US = Double.parseDouble (input);
                    System.out.print("US to Yen: ");
                    System.out.println(twoPrecision.format(US * YEN));
                  US = Double.parseDouble (input);
                    System.out.print("US to Cad: ");
                    System.out.println(twoPrecision.format(US * CAD));
              catch(NumberFormatException e)
                   JOptionPane.showMessageDialog(null,
                                    "You must enter a number",
                                    "Input data error",
                                    JOptionPane.ERROR_MESSAGE);
    }

    Try this:
    import java.text.*;
    import javax.swing.*;
    import java.io.*;
    public class Converter
         private final static double EURO = .8295577, YEN = 115.614, CAD = 1.17781;
         public static void main (String[] args)
               double US= 0.0;
               DecimalFormat twoPrecision = new DecimalFormat("0.00");
               try{
                   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
             String input=br.readLine();
                   US = Double.parseDouble (input);
                    System.out.print("US to Euro: ");
                    System.out.println(twoPrecision.format(US * EURO));
                  US = Double.parseDouble (input);
                    System.out.print("US to Yen: ");
                    System.out.println(twoPrecision.format(US * YEN));
                  US = Double.parseDouble (input);
                    System.out.print("US to Cad: ");
                    System.out.println(twoPrecision.format(US * CAD));
              catch(Exception e)
                   JOptionPane.showMessageDialog(null,
                                    "You must enter a number",
                                    "Input data error",
                                    JOptionPane.ERROR_MESSAGE);
    }

  • Unable to connect appstore and itune... i dont know whats wrong with u guys we are using apple beacause of the service but i think know better to move to samsung s 6 ...

    very bad service very bad srsly you guys are making fool
    customer buy iphone because of this service
    from mng my app store is not working i have iphone 6 i think my phone have problem i reset all setting... and now i dont have anyy app to use
    pls asap pls pls

    As per the Apple iCloud status page, they are having issues. Do not make changes at your end.
    https://www.apple.com/support/systemstatus/
    Edit

  • I dont know what wrong with my Apple ID , when i tried to updated my apps and the always asking for payment?

    i try to updated my apps and download free apps but my Apple id keep asking for payment, the exacly massage is " before you can make purchases you must tap OK , then verify your payment. before i used to have NONE but after i buy some Apps i put my debite card number. after that i want to change to be none again but None is not show... now i cannot update anything or even download free apps

    I have the same problem - it is maddening. I rely on this iPad for work so this is not just an annoyance! The above solutions of changing the appleid on the device or on the website do not work.
    The old email address no longer exists - I haven't used it in a year probably and I no longer have the account.  I logged into the appleid website and there is no trace of the old email address so there is nothing that can be deleted or changed there.  On the iPad there is no trace of the old email address so nothing can be deleted there either. I have updated the iPad software and the same problem comes right back.  Every 2 seconds I am asked to log in using the old non-existent email.  The device is currently useless.
    The only recent change to anything was the addition of an Apple TV device, which was set up using the correct login and password.
    Does anyone have any ideas? The iPad has been backed up to the iCloud so presumably it now won't recognize the current iCloud account? So restoring may notbe an option?

  • Pls give me a hand and have a look, i dont know whats wrong with it

    it said-
    Order.java:45: connot reslove symbol
    symbol: class View
    location: class Order
    View my View = View();
    import java.io.*;
    import java.util.*;
    public class Order {
         private int SupplierID;
         private String SupplierName;
         private int HouseNumber;
         private String Address1;
         private String Town;
         private String County;
         private String PostCode;
         private int ShrubID;
         private String ShrubName;
         private String Genus;
         private String Species;
         private String Variety;
         private int Quantity;
         private double Price;
         public Order (int SuID, String SuN, int Hno, String Add, String T, String C, String PC,int ShID, String ShN, String G, String S, String V, int Q, double P){
              SupplierID = SuID;
              SupplierName = SuN;
              HouseNumber = Hno;
              Address1 = Add;
              Town = T;
              County = C;
              PostCode = PC;
              ShrubID = ShID;
              ShrubName = ShN;
              Genus = G;
              Species = S;
              Variety = V;
              Quantity = Q;
              Price = P;
              public boolean View() throws IOException{
                   View myView  = new View();
                   myView.getSupplierID(SupplierID);
                   myView.getSupplierName(SupplierName);
                   myView.getHouseNumber(HouseNumber);
                   myView.getAddress1(Address1);
                   myView.getTown(Town);
                   myView.getCounty(County);
                   myView.getPostCode(PostCode);
                   myView.getShrubID(ShrubID);
                   myView.getShrubName(ShrubName);
                   myView.getGenus(Genus);
                   myView.getSpecies(Species);
                   myView.getVariety(Variety);
                   myView.getQuantity(Quantity);
                   myView.getPrice(Price);
              boolean returnCode; returnCode = false;
                   try{
                        File outputFile = new File ("Order.html");
                        FileWriter writeBuffer = new FileWriter(outputFile);
                        BufferedWriter bufferedWriter = new BufferedWriter(writeBuffer);
                        writeBuffer.write("<html> \n \r");
                        writeBuffer.write("<head> \n \r");
                        writeBuffer.write("<title>Order</title>\n\r");
                        writeBuffer.write("</head> \n \r");
                        writeBuffer.write("<body> \n \r");
                        writeBuffer.write("<div align='right'> \n \r");
                        writeBuffer.write("<FONT> face = 'Times New Roman'<P>address1</P></FONT> \n \r");
                        writeBuffer.write("</div align='right'> \n \r");
                        writeBuffer.write("<div align='left'> \n \r");
                        writeBuffer.write("<FONT>  face = 'Times New Roman'<P>"+ Address1 +"</P></FONT> \n \r");
                        writeBuffer.write("</div align='left'> \n \r");
                        writeBuffer.write("<P>Order description</P> \n \r");
                        writeBuffer.write("<p>" + ShrubName + ", " + Genus + ", " + Species + ", " + Variety + "</p>\n \r");
                        writeBuffer.write("<p>Total Price =" + (Quantity*Price) + "</p>");
                        writeBuffer.write("</body> \n \r");
                        writeBuffer.write("</html>");
                        bufferedWriter.close();
                        returnCode = true;
                        catch (IOException e) {
              return returnCode;
    }

    Hi,
    It means that there is no class with the name View. You either need to write it, or import it.
    /Kaj

  • Passing events - whats wrong with this code?

    hi,
    I'm trying to get components to behave in a frame like they would as though I had written
    frame.getContentPane().add(thecomponent);
    by processing events explicitly. I've written the code below as a test, and it does work, but the events do not seem to be passed to the component at the right level.
    For example, when the JTree is the component tried it does not expand nodes when you click on them.
    Or if you tree a JButton then it doesn't actually visibly "click"
    I'm still quite new with Swing so any help would be really appreciated - is this kind of thing even possible?
    thanks,
    asjf
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    public class EventTest extends Component
         Component notAttached;
         class SimpleMouseListener implements MouseListener
              String owner;
              Component passOnTo;
              SimpleMouseListener(String owner, Component passOnTo)
                   this.owner = owner;
                   this.passOnTo = passOnTo;
              public void mouseClicked(MouseEvent e){passOn(e);}
              public void mousePressed(MouseEvent e){passOn(e);}
              public void mouseReleased(MouseEvent e){passOn(e);}
              public void mouseEntered(MouseEvent e){passOn(e);}
              public void mouseExited(MouseEvent e){passOn(e);}
              public void passOn(MouseEvent e)
                   System.out.println(owner+" "+e);
                   if(passOnTo!=null)
                        passOnTo.dispatchEvent(
                             new MouseEvent(passOnTo,
                                                      e.getID(),
                                                      System.currentTimeMillis(),
                                                      e.getModifiers(),
                                                      e.getX(), // needs offsetting relative to parent
                                                      e.getY(), // needs offsetting relative to parent
                                                      e.getClickCount(),
                                                      e.isPopupTrigger()
         EventTest()
              super();
              notAttached = new JTree(); //JButton("Hello");
                   notAttached.setSize(100,100);
                   notAttached.setVisible(true);
                   notAttached.addMouseListener(new SimpleMouseListener("unattached component",null));
         public void paint(Graphics g){notAttached.paint(g);}
         static void main(String [] arg) throws Exception
              JFrame frame = new JFrame("Passing events test");
                   frame.setSize(640,480);
                   frame.setVisible(true);
                   EventTest et = new EventTest();
                   frame.getContentPane().add(et);
                   frame.addMouseListener(et.new SimpleMouseListener("Frame listener",et.notAttached));
    }

    Sorry
    It doesn't compile.
    I'm not sure how to create the 6 processes to each add part of sum and then update the total for the next processor to sum the next part up, and i don't know where it goes either.
    I think it would be something like:
    public void run()
    try
    //this add it up
    total= array + total;
    System.out.println("PROCESSOR"+thisnumber+" Your total is " + total);
    sleep();
    update(total)
    and then do the same code for another processor.
    I'm confused do I have to name each processor and put the name in :
    public void Processor1 ()
    please help I'm very confused
    }

  • Whats wrong with this code? Error 1180.

    I keep getting the error 1180:Call to a possible undefined method getURL
    var jscommand:String = "window.open('www.adobe.com','win','height=1024,width=768,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);");
    Any help would be appreciated.
    Thanks guys.

    Got it.
    Thanks!

  • Oh man i dont know whats wrong.... plz help urgent...

    i dont know whats wrong with my n900.... a couple of weeks before i tried to install nitroid gingerbread on my n900.... i did exactly what it said it was almost complete but the last step didnt complete so i left it like that..... i was using my mobile fine until one day i restarted my phone... when  it started it showed me 2 options (dont remember what the options were) although the 2nd one was power kernel something like that.... i chose 1st option after that it turned off when i startit again only nokia logo comes and it turns off by himself.... i thinki bricked my fone... but y didnt it happen when i was trying to install nitroid... plz help any way to fix it....
    P.S. I cant flash it either.. it doesnt go to usb mode anymore neither does it charge....
    Solved!
    Go to Solution.

    you could try to do the commands in flasher, connect the device while it is off and holding the U button down and see if the flasher will see it.

Maybe you are looking for

  • External FW HD won't/will mount

    Here's a little conundrum which has partly resolved itself and hopefully no longer causes a problem, but I would welcome opinions on what might be going on. I have 2 x G4 Quicksilvers and a PowerBook. G4-1 runs 9.2.1. G4-2 runs 9.2.2 and sometimes 10

  • External Monitor Preferences

    I bring my Macbook Pro to work every day and plug it into an external monitor on my desk. When I plug it in, I have to go through a routine that involves changing the resolution on the external monitor, then switching it back to mirror displays (beca

  • Logic unexpectidly quits

    I reinstaled logic like 2 days ago and now, when i open it it says this, logicpro has unexpectidly quit the current song has been saved as "untitled (crashed).iso" IN another window it says the application logic pro has quit un expectedly mac os x an

  • System number used by user

    Hi Experts,                    If i have the userd i.d., date of the user who has created a material/master recipe/resource, is it possible to find the system number which the user was logged on ? Regards Sm. Edited by: Sm on Nov 4, 2009 6:10 AM Edit

  • IWeb '09 Widgets Not Responding?

    So I just recently upgraded to iLife '09 and every thing's working great except for the widgets in iWeb. I was trying to use the HTML snippet, and instead of the little box that pops up to put the actual code in, I had an empty box on the screen that