I want help doing simple programing on numbers.

I am too lazy to try to learn it on my own. My first project would be to take the simple employee schedule template under Business in Numbers and modify it to add some sales projections. Very simple stuff.  Is there a company tha

Under Numbers there is a template under Business that is labled Employee Schedule.
1.  Overall the schedule is pretty good but the time for clocking in an employee only goes to 11. We are a restaurant/brewery we need clock in times as late at 9 PM and clock outs as late as 3 AM. Need that expanded.
2.  I would like that spreadsheet to flood another spreadsheet immediately below the schedule that takes total gross salaries for each day. Start with Sunday thru Saturday. So whichever employee works on Sun gets added to the Sunday total. It would look like this, first column has the days of the week ie sun, mon, tues etc next column shows the expected total salaries for the day from the Employee Schedule.
3. Next column would have projected sales. This number would be filled in by the supervisor and he would guess sales volume for the day.
4.  The next column would be the result of dividing total gross salaries for each day by the sales projection made by the supervisor. Top of the column would read salaries/sales.
5.  There would also be a total for the week with salaries/sales as some days like Monday we will be over budget and on busy days like Friday, we would be under budget. As long as my supervisors balance to 20% I will be ok, at least for now:)
This Tool would help the supervisor to be able to set up and change sheduled hours either up or down to meet our goal of salaries not to exceed 20% of projected sales.
I can tell this is probably simple for someone that knows this stuff, but for me, hours of time and then never getting it right would be what would happen.
Thanks so much for your suggestion and I hope you or someone takes this on.
Ken Carson
Nexus Brewery
Albuquerque, NM
Even as I write it,

Similar Messages

  • How to make a simple program in numbers that i can use on my iphone

    how can i make a touchable program in numbers that i can trasfer to my iphone and use out in the field of work? i am pretty good at excel sheets,but am still new with my macbook.

    Excel can't make an iPhone application, it can only make a spreadsheet. You would need an iPhone app capable of reading a spreadsheet produced by Excel.

  • Help with simple program

    I am trying to get a program in my CS1 course and am having a hard time, help.. this is what the prof wants>>> Your employer is developing encryption software and wants you to write a Java program that will display all the prime numbers less than N, where N is a number to be entered by a user. In addition to displaying the primes themselves, provide a count of how many there are.

    here is one that i wrote. It does not add them though:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    class FindPrimes extends JFrame implements Runnable, ActionListener {
         Thread go;
         JLabel howManyLabel = new JLabel("Quantity: ");
         JTextField howMany = new JTextField("400", 10);
         JButton display = new JButton("Display primes");
         JTextArea primes = new JTextArea(8, 40);
         FindPrimes() {
              super("Find Prime Numbers");
              setSize(400, 300);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              BorderLayout bord = new BorderLayout();
              setLayout(bord);
              display.addActionListener(this);
              JPanel topPanel = new JPanel();
              topPanel.add(howManyLabel);
              topPanel.add(howMany);
              topPanel.add(display);
              add(topPanel, BorderLayout.NORTH);
              primes.setLineWrap(true);
              JScrollPane textPane = new JScrollPane(primes);
              add(textPane, BorderLayout.CENTER);
              setVisible(true);
         public void actionPerformed(ActionEvent evt) {
              display.setEnabled(false);
              if (go == null) {
                   go = new Thread(this);
                   go.start();
         public void run() {
              int quantity = Integer.parseInt(howMany.getText());
              int numPrimes = 0;
              // candidate:  the number that might be prime
              int candidate = 2;
              primes.append("First " + quantity + " primes:");
              while (numPrimes < quantity) {
                   if (isPrime(candidate)) {
                        primes.append(candidate + " ");
                        numPrimes++;
                   candidate++;
         public static boolean isPrime(int checkNumber) {
              double root = Math.sqrt(checkNumber);
              for (int i = 2; i <= root; i++) {
                   if (checkNumber % i == 0) {
                        return false;
              return true;
         public static void main(String[] arguments) {
              FindPrimes fp = new FindPrimes();
    }

  • Advanced Excel user needing help running VBA program in Numbers 09

    I am preparing for Dental school, a very tough program, indeed, and wanted to use a powerful tool that helped me out in my undergrad:
    I have developed a Visual Basic program in Excel which gives the user a few simple forms through which I can enter data (terms and definitions, or possible test information) and then take short tests, play a silly game, print flash cards and so on.
    I worked very hard to get this going on Office 2007 - very VERY hard given Office 07 is the most evil creation ever!!
    I may resort to running gulp Vista to get this running, but what a pain! I am aware that Applescript is an option, but would hope there is some compatibility with my previous work. The more code I can preserve from my previous program the less time I will have to invest in developing the Mac version.
    This is a highly advanced thing to do, and I realize most people don't do this sort of thing. If anyone is as crazy (and geeky) as me your help would be much appreciated. Thanks in advance!

    Where are you finding Applescript 3.2.1 ?
    As far as I know, the current AppleScript is 2.1.2 and is part of mac Os X 10.6.
    Office for mac is unable to use VBA.
    Numbers is unable to take benefit of this missing VBA.
    AppleScript may be used to mimic some VBA features.
    Look at :
    http://mactech.com/vba-transition-guide/index-091.html
    In fact, I guess that you grabbed Xcode 3.2.1 hoping to be able to build AppleScript applications.
    This require a serious learning curve.
    Look at :
    http://developer.apple.com/Mac/library/releasenotes/ScriptingAutomation/RN-Apple ScriptObjC/index.html
    Yvan KOENIG (VALLAURIS, France) lundi 5 avril 2010 08:01:27

  • URL: newbie needs help with simple programming question!

    Hi everyone,
    Please direct me to a FAQ or other resource, or help me with this problem:
    I want to create a text field (or similar container) that contains both ordinary text AND a URL/hyperlink in it. For example, the following text might appear in the text field:
    "I have many _pictures_ from my vacation"
    where the word "pictures" is actually a hyperlink to a web site, and the other portions of the string are simple text.
    All advice and help is appreciated!
    -Dennis Reda
    [email protected]

    Well here is one way you code do it but if you do alittle research on them links above it will explain how this code works.Well it will explain how jeditorpane and hyperlinklistener work
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.net.*;
    public class b extends javax.swing.JApplet implements HyperlinkListener  {
       JEditorPane field = new JEditorPane();
      public b() {
        Container pane = getContentPane();
        FlowLayout flo = new FlowLayout();
        pane.setLayout(flo);
        field.setPreferredSize(new Dimension(200, 25));
        field.setEditable(false);
        pane.add(field);
        setContentPane(pane);
         String gg1 = "<html><body>I have many_<a    href='http://www.home.com'>pictures</a>_from my vacation</body></html>";
         field.addHyperlinkListener(this);
         field.setContentType("text/html");
         field.setText(gg1);
      public void hyperlinkUpdate(HyperlinkEvent e) {
         if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          try{
            URL url = new URL("http://www.msn.com");
            getAppletContext().showDocument(url,"_self"); 
            }catch(Exception r) {};
      public void init()  {
         b c = new b();
    ps hope this helped                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need help with simple program

    I believe that I have everything right except when I get down to the else I want it to return to the while loop. Is there a better way of doing this because it doesn't work for me. Here is the program:
    public class ABCInput
         public static void main(String[] args) throws Exception
              char response;
              System.out.println("Please type a A,B,C to receive a message or a Q to quit");
              response = (char)System.in.read();System.in.read();System.in.read();
              while(response == 'A' || response == 'B' || response == 'C')
                   System.out.println("\"Good Job\"\n\n");
                   System.out.println("Please type a A,B,C to receive a message or a Q to quit");
                   response = (char)System.in.read();System.in.read();System.in.read();
              if(response == 'Q')
                   System.out.println("Thanks for playing");
                   System.exit(0);
              else
                   System.out.println("You have entered an invalid letter. Please try again");
                   response = (char)System.in.read();System.in.read();System.in.read();
    }

    mahugl,
    Try this out.
    public class ABCInput
         public static void main(String[] args) throws Exception
              char response;
              boolean notInvalid = true;
              boolean notFinished = true;
              System.out.println("Please type a A,B,C to receive a message or a Q to quit");
              response = (char)System.in.read();System.in.read();System.in.read();
              while(notFinished == true)
                   while(notInvalid == true)
                        if(response == 'A' || response == 'B' || response == 'C' || response == 'Q' || response == 'a' || response == 'b' || response == 'c' || response == 'q')
                             notInvalid = false;
                        else
                             System.out.println("You have entered an invalid letter. Please try again");
                             response = (char)System.in.read();System.in.read();System.in.read();
                   if(response == 'Q' || response == 'q')
                        notFinished = false;
                   else
                        System.out.println("\"Good Job\"\n\n");
                        System.out.println("Please type a A,B,C to receive a message or a Q to quit");
                        response = (char)System.in.read();System.in.read();System.in.read();
                        notInvalid = true;
              System.out.println("Thanks for playing");
              System.exit(0);
    }jerryrika

  • Help with simple program please!

    Hi. I am brand new to Java and pretty new to programming in general. I am writing a project for a class where we have to output the index at which a certain "target" string matches the "source" string. I'm stuck. I thought my code would make "compare" a string of length target.length()? Any help is greatly appreciated. Thanks!
    public static ArrayList<Integer> matches(String source, String target) {
    // check preconditions
    assert (source != null) && (source.length() > 0)
         && (target != null) && (target.length() > 0): "matches: violation of precondition";
    ArrayList<Integer> result = new ArrayList<Integer>();
    String compare = "";
    for (int i=0; i<source.length()-target.length()+1;i++){
         int count = 0;
         for (int k=i; k<i+target.length(); k++){
              compare = compare + source.charAt(k);
         for (int j=0; j<target.length(); j++){
              if (target.charAt(j) == compare.charAt(j)){
                   count ++;
         if (count == target.length()){
              result.add(i);
              return result;
    }

    I apologize, I am new to the forums and posted that code horribly. Here is the accurate code.
        public static ArrayList<Integer> matches(String source, String target) {
            // check preconditions
            assert (source != null) && (source.length() > 0)
                 && (target != null) && (target.length() > 0): "matches: violation of precondition";
            ArrayList<Integer> result = new ArrayList<Integer>();
            String compare = "";
            for (int i=0; i<source.length()-target.length()+1;i++){
                 int count = 0;
                 for (int k=i; k<i+target.length(); k++){
                      compare = compare + source.charAt(k);
                 for (int j=0; j<target.length(); j++){
                      if (target.charAt(j) == compare.charAt(j)){
                           count ++;
                 if (count == target.length()){
                      result.add(i);
              return result;
        }

  • Help, a simple program!!

    this is my program:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ActionDemo extends JFrame {
    protected JTextArea textArea;
    protected String newline = "\n";
    protected Action openAction;
    protected Action editAction;
    public ActionDemo() {
    //Do frame stuff.
    super("IP address transformation");
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    JMenu fileMenu = new JMenu("File");
    JMenu editMenu = new JMenu("Edit");
    createActionComponents(fileMenu,editMenu);
    textArea = new JTextArea(5, 30);
    JScrollPane scrollPane = new JScrollPane(textArea);
    JPanel contentPane = new JPanel();
    contentPane.setLayout(new BorderLayout());
    contentPane.setPreferredSize(new Dimension(400, 150));
    //contentPane.add(toolBar, BorderLayout.SOUTH);
    contentPane.add(scrollPane, BorderLayout.CENTER);
    setContentPane(contentPane);
    JMenuBar mb = new JMenuBar();
    mb.add(fileMenu);
    mb.add(editMenu);
    setJMenuBar(mb);
    protected void createActionComponents(JMenu fileMenu, JMenu editMenu) {
    JMenuItem fileMenuItem = null;
    JMenuItem editMenuItem = null;
    openAction = new AbstractAction("Open") {
    public void actionPerformed(ActionEvent e) {
    editAction = new AbstractAction("Copy") {
    public void actionPerformed(ActionEvent e) {
    fileMenuItem = fileMenu.add(openAction);
    editMenuItem.setIcon(null); //arbitrarily chose not to use icon in menu
    editMenuItem = editMenu.add(editAction);
    editMenu.setIcon(null);
    public static void main(String[] args) {
    ActionDemo frame = new ActionDemo();
    frame.pack();
    frame.setVisible(true);
    it can be compiled, but i can't run, the error message is as follows:
    E:\temp\����������>java ActionDemo
    Exception in thread "main" java.lang.NullPointerException
    at ActionDemo.createActionComponents(ActionDemo.java:58)
    at ActionDemo.<init>(ActionDemo.java:27)
    at ActionDemo.main(ActionDemo.java:71)
    why??

    editMenuItem.setIcon(null); //arbitrarily trarily chose not to use icon in menuNo wonder yo get an exception, since you're trying to set the icon for the JMenuItems to null. Just don't call that method if you don't want icons to be displayed. Why bother setting them to null anyway?

  • Help with simple programming

    Hello everyone.
    First time posting, i hope someone would be able to help me out. There are 5 classes that i have to do, but i only need help with one of them. I've been stuck on this one pretty long and can't continue without it.
    Instructions:
    •     Has boolean data member face, either HEADS or TAILS.
    •     Has a Random data member flipper which is instantiated in the constructor.
    •     Class constructor has no parameters and randomly chooses the result HEADS or TAILS. (See method flip())
    •     Method getFace() returns the face showing on the coin.
    •     void method flip() randomly selects HEADS or TAILS.
    package coinflip;
    import java.util.Random;
    * @author Blank
    public class Coin {
        boolean face = false;
        int flip_coin;
        Random flipper = new Random();
        int getFace() {
            return flip_coin;
          Coin() {
            if (flip_coin == 0) {
                face = true;
            } else {
                face = false;
        public void flip() {
            flip_coin = flipper.nextInt(2);
    }i really don't know why the random isn't working. I hope someone would be able to find my errors and instruct me on how to fix them. I would be able to continue the rest of the classes as soon as i got this figured out.
    Oh and can someone teach me how to import this class into a main one? So i can test it out. This is what i have for it.public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
         Coin flipCoin = new Coin();
         for(int i=0;i<6;i++){
         System.out.println(flipCoin.getFace());
    }Many Thanks!
    Edited by: Java_what on Feb 16, 2009 2:26 PM

    Constructors are only executed once. What im confused about is:
    • Class constructor has no parameters and randomly chooses the result HEADS or TAILS. (See method flip())
    I thought i would flip() into the constructor. Mind helping me out on the whole class because it seems i am clueless about this whole class.
    Edit:
    public class Coin {
        boolean face = false;
        int flip_coin;
        Random flipper = new Random();
        int getFace() {
            flip();
            return flip_coin;
        Coin() {
           //flip();
        public void flip() {
            flip_coin = flipper.nextInt(2);
    }K i reread what you wrote about the constructor and method. So i placed flip() method in getFace(); because its being called in the main(it gives me random numbers). The problem now is following the directions.
    I just dont understand this description. • Class constructor has no parameters and randomly chooses the result HEADS or TAILS. (See method flip())
    What do you think it means.
    Edited by: Java_what on Feb 16, 2009 4:14 PM

  • Hi need help with simple program

    1 System.out.println("Input Number of Question: ");
    2
         3     inputQuestionNum = Integer.parseInt(input.nextLine());
              4     
              5     if(inputQuestionNum>=10) {
              6          System.out.println("Error: Please try again"); //how to return to line 1      
    7 else { 
    8      System.out.println("ok");     
    9 }
    Hi, i am new to java, how to make the program return back to first line when input is more then 10? I do not know how to describe my problem therefore i can't google for solution. thank you in advance.

    The usual approach is to use a do-while loop:Scanner input = new Scanner (System.in);
    int inputQuestionNum;
    do {
        System.out.println ("Input Number of Question: ");
        inputQuestionNum = Integer.parseInt (input.nextLine ());
        if (inputQuestionNum >= 10) {
            System.out.println ("Error: Please try again");
        } else {
                System.out.println ("ok");
        } while (inputQuestionNum >= 10);Ask if that's not clear.
    db

  • What do I do now that Photoshop CC has encountered an error while trying to upgrade. Suggesting retry does nothing. The numbers (49) appear, but I don't know what that signifies. Help?

    What do I do now that Photoshop CC has encountered an error while trying to upgrade. Suggesting retry does nothing. The numbers (49) appear, but I don’t know what that signifies. Help?
    It is recommended that I ask for help, which put me here. What I really need is some customer service — not a chat room!

    If Windows :
    Quit Creative Cloud desktop application .
    Launch Photoshop cc 2014 application from C: > Program Files > Adobe Photoshop CC 2014 .
    Once launched , click on Help menu in Photoshop cc 2014 and select Updates option .
    It should update.
    If Mac:
    Quit Creative Cloud desktop application .
    Launch Photoshop cc 2014 application from Applications folder:
    Once launched , click on Help menu in Photoshop cc 2014 and select Updates option .
    Let me know if you face any error .
    Error 49 occurs while updating the application , when Creative Cloud app  does not have reference / Access to installed CC app, so that it can apply updates for the same .
    You can try to update from CC app  like Photoshop itself and check.

  • Please help me with simple program

    Can someone please write a simple program for me that opens up a webpage in the center of the screen , with a set size, and then asks the user where they would like to click on the screen. Then once the person clicks it asks how many times they would like to click there, and then once they enter the # the program opens up the webpage (in the center at the same spot as before, with the same set size) and automatically clicks on the predesignated spot , and then closes all open internet windows, and keeps doing it for however many times the person chose. PLEASE HELP ME WITH THIS!!! If you could, please post the source code here. Thank you so much to whoever helps me!!!!!!!

    If it's not to learn, then what is the purpose of
    this project?well, if it's not HW and its not for learning java, then why the hell would anyone like to have a program that may open a webpage and then repeatedly click on predefined place...
    let me see...
    now if he had asked for program that fakes IP as well, then i would suggest that he tryes to generate unique clicks, but now... i'm not sure... maybe just voting in some polls or smthing... though, i would not create a program that clicks on the link or form element, but rather just reload url with given parameters for N times...

  • Need help with a simple program (should be simple anyway)

    I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
    ====================================================
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Message extends JFrame implements ActionListener {
         public void actionPerformed(ActionEvent evt) {
         text1.setText(" ");
         text2.setText("RE: ");
         text3.setText(" ");
         public Message() {
         super("Write a Message - by Kieran Hannigan");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setSize(370,270);
         FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
         setLayout(flo);
         //Make the bar
         JMenuBar bar = new JMenuBar();
         //Make "File" on Menu
         JMenu File = new JMenu("File");
         JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
         JMenuItem f2 = new JMenuItem("Open");
         JMenuItem f3 = new JMenuItem("Save");
         JMenuItem f4 = new JMenuItem("Save As");
         JMenuItem f5 = new JMenuItem("Exit");
         File.add(f1);
         File.add(f2);
         File.add(f3);
         File.add(f4);
         File.add(f5);
         bar.add(File);
         //Make "Edit" on menu
         JMenu Edit = new JMenu("Edit");
         JMenuItem e1 = new JMenuItem("Cut");
         JMenuItem e2 = new JMenuItem("Paste");
         JMenuItem e3 = new JMenuItem("Copy");
         JMenuItem e4 = new JMenuItem("Repeat");
         JMenuItem e5 = new JMenuItem("Undo");
         Edit.add(e5);
         Edit.add(e4);
         Edit.add(e1);
         Edit.add(e3);
         Edit.add(e2);
         bar.add(Edit);
         //Make "View" on menu
         JMenu View = new JMenu("View");
         JMenuItem v1 = new JMenuItem("Bold");
         JMenuItem v2 = new JMenuItem("Italic");
         JMenuItem v3 = new JMenuItem("Normal");
         JMenuItem v4 = new JMenuItem("Bold-Italic");
         View.add(v1);
         View.add(v2);
         View.add(v3);
         View.addSeparator();
         View.add(v4);
         bar.add(View);
         //Make "Help" on menu
         JMenu Help = new JMenu("Help");
         JMenuItem h1 = new JMenuItem("Help Online");
         JMenuItem h2 = new JMenuItem("E-mail Programmer");
         Help.add(h1);
         Help.add(h2);
         bar.add(Help);
         setJMenuBar(bar);
         //Make Contents of window.
         //Make "Subject" text field
         JPanel row2 = new JPanel();
         JLabel sublabel = new JLabel("Subject:");
         row2.add(sublabel);
         JTextField text2 = new JTextField("RE:",24);
         row2.add(text2);
         //Make "To" text field
         JPanel row1 = new JPanel();
         JLabel tolabel = new JLabel("To:");
         row1.add(tolabel);
         JTextField text1 = new JTextField(24);
         row1.add(text1);
         //Make "Message" text area
         JPanel row3 = new JPanel();
         JLabel Meslabel = new JLabel("Message:");
         row3.add(Meslabel);
         JTextArea text3 = new JTextArea(6,22);
         messagearea.setLineWrap(true);
         messagearea.setWrapStyleWord(true);
         JScrollPane scroll = new JScrollPane(text3,
                                  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                  JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         //SpaceLine
         JPanel spaceline = new JPanel();
         JLabel spacer = new JLabel(" ");
         spaceline.add(spacer);
         row3.add(scroll);
         add(row1);
         add(row2);
         add(spaceline);
         add(spaceline);
         add(row3);
         setVisible(true);
         public static void main(String[] arguments) {
         Message Message = new Message();
    }

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • Does LabView program behave differentl​y under Traditiona​l Chinese version from regular English version. The program reads in numbers and characters from input files.

    Does LabView program behave differently under Traditional Chinese version from regular English version. The program reads in numbers and characters from input files.

    Hope this helps,
    Ankita

  • Need Help with Simple Chat Program

    Hello Guys,
    I'm fairly new to Java and I have a quick question regarding a simple chat program in java. My problem is that I have a simple chat program that runs from its own JFrame etc. Most of you are probably familiar with the code below, i got it from one of my java books. In any case, what I'm attempting to do is integrate this chat pane into a gui that i have created. I attempted to call an instace of the Client class from my gui program so that I can use the textfield and textarea contained in my app, but it will not allow me to do it. Would I need to integrate this code into the code for my Gui class. I have a simple program that contains chat and a game. The code for the Client is listed below.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class Client
    extends JPanel {
    public static void main(String[] args) throws IOException {
    String name = args[0];
    String host = args[1];
    int port = Integer.parseInt(args[2]);
    final Socket s = new Socket(host, port);
    final Client c = new Client(name, s);
    JFrame f = new JFrame("Client : " + name);
    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    c.shutDown();
    System.exit(0);
    f.setSize(300, 300);
    f.setLocation(100, 100);
    f.setContentPane(c);
    f.setVisible(true);
    private String mName;
    private JTextArea mOutputArea;
    private JTextField mInputField;
    private PrintWriter mOut;
    public Client(final String name, Socket s)
    throws IOException {
    mName = name;
    createUI();
    wireNetwork(s);
    wireEvents();
    public void shutDown() {
    mOut.println("");
    mOut.close();
    protected void createUI() {
    setLayout(new BorderLayout());
    mOutputArea = new JTextArea();
    mOutputArea.setLineWrap(true);
    mOutputArea.setEditable(false);
    add(new JScrollPane(mOutputArea), BorderLayout.CENTER);
    mInputField = new JTextField(20);
    JPanel controls = new JPanel();
    controls.add(mInputField);
    add(controls, BorderLayout.SOUTH);
    mInputField.requestFocus();
    protected void wireNetwork(Socket s) throws IOException {
    mOut = new PrintWriter(s.getOutputStream(), true);
    final String eol = System.getProperty("line.separator");
    new Listener(s.getInputStream()) {
    public void processLine(String line) {
    mOutputArea.append(line + eol);
    mOutputArea.setCaretPosition(
    mOutputArea.getDocument().getLength());
    protected void wireEvents() {
    mInputField.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    String line = mInputField.getText();
    if (line.length() == 0) return;
    mOut.println(mName + " : " + line);
    mInputField.setText("");

    Thanks for ur help!i have moved BufferedReader outside the loop. I dont think i am getting exception as i can c the output once.What i am trying to do is repeat the process which i m getting once.What my method does is first one sends the packet to multicasting group (UDP) and other method receives the packets and prints.

Maybe you are looking for

  • Report on Settlement - Project wise/ WBS element wise

    Hello Friends, I am looking for a report on settlement which will include the senders - Projects or WBS elements and Settlement receivers and the amount settled in the any period for a particular fiscal year. Your response will be rewarded. Vishal.

  • Error while sending transaction

    Hi All, We are facing below error while sending transactions, We are able to send successfully OAGIS file to supplier using custom documnet over internet, but in the reports after couple of sceond it showing one blank error. EX: Machine Info: (usstlz

  • Unallocated Disk Space after Recovery

    I performed a system recovery to factory settings that resulted in my Disk space being distributed differently than before. I have a lot of unallocated space as you can see bellow. I need to know how to fix and how to prevent this from happening the

  • Regarding BW security

    Hi All, Could you please share some BW Security documents. This is very Urgent...Please... Thanks Vasu

  • Hide 'Change Layout' button from alv toolbar

    Hello All, can anyone let me know how can we hide the change layout button or exclude the change layout button from the ALV tool bar using OOPS . what's the fcode for it. Thank You ! Ravi