Button not appearing (obvious fix most likely (no errors))

import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.*;
public class ChatClient
  private TextArea output;
  private TextField input;
  private Button sendButton;
  private Button quitButton;
  private JButton button;
  private ImageIcon image;
  private ImageIcon image1;
  private Panel p1;
  private Frame frame;
  private Panel p2;
  public ChatClient()
    output = new TextArea(10,50);
    input = new TextField(50);
    frame = new Frame("Chat Room");
    sendButton = new Button("Send");
    quitButton = new Button("Quit");
    button = new JButton(image);
    image = new ImageIcon("c:/aztecsun.jpg");
    image1 = new ImageIcon("c:/aztecsun.jpg");
    p1 = new Panel();
    p2 = new Panel();
  public void launchFrame()
           button.setContentAreaFilled(false);
           button.setBorderPainted(false);
           button.setFocusPainted(false);
           button.setPressedIcon(image1);
           p1.add(sendButton);
           p1.add(quitButton);
           p2.add(button);
         // Use the Border Layout for the frame
         frame.setLayout(new BorderLayout());
         frame.add(output, BorderLayout.WEST);
         frame.add(input, BorderLayout.SOUTH);
         frame.add(p1, BorderLayout.EAST);
         frame.add(p2, BorderLayout.CENTER);
         // Add the button panel to the center
         frame.pack();
         frame.setVisible(true);
         //frame.addWindowListener(this);
         sendButton.addActionListener(new sendHandler());
         input.addActionListener(new inputHandler());
         button.addActionListener(new azteca());
         quitButton.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent ae)
                   System.exit(0);
         frame.addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent we)
                   System.exit(0);
  /*     class windowTerminate implements WindowListener
            public void windowClosing(WindowEvent we)
                 System.exit(0);
            public void windowDeactivated(WindowEvent we)
            public void windowIconified(WindowEvent we)
            public void windowDeiconified(WindowEvent we)
            public void windowActivated(WindowEvent we)
            public void windowOpened(WindowEvent we)
            public void windowClosed(WindowEvent we)
   class azteca implements ActionListener
          public void actionPerformed(ActionEvent ae)
               if(ae.getSource() == button)
                    String text = input.getText();
                    output.setText(output.getText() + text + "/n");
                    input.setText("");
       public void copyText()
            String text = input.getText();
            output.setText(output.getText() + text + "\n");
            input.setText("");
       class sendHandler implements ActionListener
            public void actionPerformed(ActionEvent ae)
                 copyText();
       class inputHandler implements ActionListener
            public void actionPerformed(ActionEvent ae)
                 copyText();
  public static void main(String[] args)
    ChatClient c = new ChatClient();
    c.launchFrame();
}I'm practicing with events/buttons with icons and the button is not appearing...
Yes the image is in the correct directory... (for the obvious fix type of people)...
But yeah...
Thanks!

I know the fix but I do not know how to do it... I haven't added the image button correctly therefore it is not appearing, but I lack the necessary skills to fix the problem.
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.*;
public class ChatClient
  private JTextArea output;
  private JTextField input;
  private JButton sendButton;
  private JButton quitButton;
  private JButton button;
  private ImageIcon image;
  private ImageIcon image1;
  private JPanel p1;
  private JFrame frame;
  private JPanel p2;
  public ChatClient()
    output = new JTextArea(10,50);
    input = new JTextField(50);
    frame = new JFrame("Chat Room");
    sendButton = new JButton("Send");
    quitButton = new JButton("Quit");
    button = new JButton(image);
    image = new ImageIcon("c:/aztecsun.jpg");
    image1 = new ImageIcon("c:/aztecsun.jpg");
    p1 = new JPanel();
    p2 = new JPanel();
  public void launchFrame()
           button.setContentAreaFilled(false);
           button.setBorderPainted(false);
           button.setFocusPainted(false);
           button.setPressedIcon(image1);
           p1.add(sendButton);
           p1.add(quitButton);
           p2.add(button);
         // Use the Border Layout for the frame
         frame.setLayout(new BorderLayout());
         frame.add(output, BorderLayout.WEST);
         frame.add(input, BorderLayout.SOUTH);
         frame.add(p1, BorderLayout.EAST);
         frame.add(p2, BorderLayout.CENTER);
         // Add the button panel to the center
         frame.pack();
         frame.setVisible(true);
         //frame.addWindowListener(this);
         sendButton.addActionListener(new sendHandler());
         input.addActionListener(new inputHandler());
         button.addActionListener(new azteca());
         quitButton.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent ae)
                   System.exit(0);
         frame.addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent we)
                   System.exit(0);
  /*     class windowTerminate implements WindowListener
            public void windowClosing(WindowEvent we)
                 System.exit(0);
            public void windowDeactivated(WindowEvent we)
            public void windowIconified(WindowEvent we)
            public void windowDeiconified(WindowEvent we)
            public void windowActivated(WindowEvent we)
            public void windowOpened(WindowEvent we)
            public void windowClosed(WindowEvent we)
   class azteca implements ActionListener
          public void actionPerformed(ActionEvent ae)
               if(ae.getSource() == button)
                    String text = input.getText();
                    output.setText(output.getText() + text + "/n");
                    input.setText("");
       public void copyText()
            String text = input.getText();
            output.setText(output.getText() + text + "\n");
            input.setText("");
       class sendHandler implements ActionListener
            public void actionPerformed(ActionEvent ae)
                 copyText();
       class inputHandler implements ActionListener
            public void actionPerformed(ActionEvent ae)
                 copyText();
  public static void main(String[] args)
    ChatClient c = new ChatClient();
    c.launchFrame();
}Edited by: Trizi on Mar 25, 2008 11:52 AM

Similar Messages

  • Buttons not appearing clearly upon output

    I have created menu buttons (with highlight) that in turn link to the relevant movie file.
    When outputted to DVD these buttons appear blurry and unclear.
    Why are the buttons not appearing in a crisp, clean state when I have outputted them?

    Which version of DVD SP are you using? Are you
    making these over video menus? What size and color
    of fonts/background? They can all play into what is
    happening, usually 20pt + sans serif works best, but
    the text in DVD SP can often leave things to be
    desired from time to time - where are you previewing
    the buttons?
    Thanks for your reply.
    The vesrion Im using is DV Studio Pro 3. The up state color of the buttons are black and over is red. The font size is 13pt Arial Black.
    I have outputted the DVD itself, so I view it through TV.
    Am I on the right track?
    Thanks again.

  • In formcentral, why does the "proceed to checkout" button not work? on IE I get error " This content cannot be displayed in a frame...

    In formcentral, why does the "proceed to checkout" button not work? on IE I get error " This content cannot be displayed in a frame. To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame ". On Chrome I get nothing but loading.

    Hi,
     This error is generally specific to Internet Explorer and has two possible causes. The most likely explanation is that your browser has unusual browser security settings. I would recommend you try
    resetting your security settings to defaults (varies by version but all essentially the same). You may also have to turn off
    Protected Mode which is enabled by default on some systems. If you’re seeing this error (or a version of it) outside Internet Explorer, you may have a server-level setting that is preventing your content from being framed.
    Reference:https://social.technet.microsoft.com/Forums/exchange/en-US/1460c5a5-6242-4402-9f6b-bc581bf56478/content-cannot-be-displayed-in-a-frame-when-trying-to-add-item?forum=sharepointgeneral
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • FaceTime buttons not appearing on iPad mini

    sometimes the facetime time buttons do not appear so I cannot end a call or reverse camera. How do you fix this

    Try to reset your network settings (make note of the current settings to revert back to)
    Settings>General>Reset>Reset Network Settings
    Afterwards, restore your settings manually and reconfigure your FaceTime and iMessage settings as well as all other network related settings.
    There seems to some issues with iMessage/FaceTime when moving between timezones and setting the date/time manually to your specific area should usually clear it up (from what I've read). That being said (and if you've already tried the date/time trick), try to reset your network settings.

  • Buttons not appearing on web

    I have a form with a button which dynamically pops up in front of text items (using set_item property, position and visible). This works on c/s but on the web the button does not appear. Is there a reason for this ? I have fixed it using stacked canvases but it was a nuisance to have to do so.

    Strictly speaking it's a bug in client server - items should not be able to directly overlay each other, unless only one of them is visible. (or you are using a stacked canvas)

  • Buttons not appearing when published

    Hi there,
    I have never had this problem before with RoboHelp. I work as
    a contractor in many different companies and I can't say that
    RoboHelp is always setup and configured the same way each time.
    I am currently using version 5.0.2 and I am using a skin that
    I have modified with the company colours etc. When I preview the
    skin, it all looks fine, but when I generate/publish the previous,
    next, sync and close buttons above the contents do not appear.
    Does anyone know why and what I can do to fix this. Like I
    said, it's never happened to me before on any other RoboHelp
    projects. Thanks.

    Hi again
    I attempted to allude to this in the article. Essentially,
    here is how you coax them to show. For the Sync TOC button, if you
    expand the Single Source Layouts pseudo folder, then right-click
    the WebHelp layout and choose properties from the context menu, you
    should see several dialogs. Click the Next > button and look at
    the "Synchronize TOC" option. To the right of this option is a
    drop-down. If you see "Automatically" listed there, this means the
    Sync TOC icon will not appear in the mini toolbar. So to coax it to
    show, change Automatically to Manually.
    The close button is a bit of a mystery. I've never known it
    not to be present. This makes me wonder what browser and version
    you may be using.
    Cheers... Rick

  • Buttons not appearing after exporting to Interactive PDF

    I created buttons on my master page in InDesign with the event "on click" and actions "go to first page", "go to last page", "go to previous page", and "go to next page". Then I applied my master page to all the pages in my document. On certain pages I override the item on the master page and gave the button a different action (go to text anchor). Then I exported to Adobe PDF (Interactive). When I view the PDF, most of the Master Page buttons do not appear. This doesn't happen every time. I have created documents that work with this setup, but this one document will not work properly. Any suggestions?

    Try exporting IDML, Open IDML, Export from new doc

  • ADF Buttons not appearing correctly

    I've tried researching this problem and from what I've found it has said if we are using JDK version 1.4 and headless = true then we shouldn't have this problem. When running our application some of our ADF buttons will appear correctly and others will not.
    When I look in our
    application-deployments/../temp/adf/images/cache/en/
    directory I can see the images of the buttons that appear correctly, but if I navigate to another page with different buttons I would then expect to see those images being creating in that folder but there are not. If anyone has any insight on this problem it would be a big help. Thanks.

    Nothing leaps to mind that affected downloadable fonts in Firefox 34... but there are hundreds of changes in each version so I can't rule it out.
    Just to go back to basics for a moment...
    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Bypass Firefox's Cache
    Use Ctrl+Shift+r to reload the page fresh from the server.
    Alternately, you also can clear Firefox's cache completely using:
    "3-bar" menu button (or Tools menu) > Options > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now"
    If you have a large hard drive, this might take a few minutes.
    (2) Remove the site's cookies (save any pending work first). While viewing a page on the site, try either:
    * right-click and choose View Page Info > Security > "View Cookies"
    * Alt+t (open the classic Tools menu) > Page Info > Security > "View Cookies"
    In the dialog that opens, you can remove the site's cookies individually.
    Then try reloading the page. Does that help?

  • Radio Buttons Not Appearing in Quiz

    I created a quiz in Captivate 5.5 then upgraded to Captivate 6.  When I run the quiz locally, the radio buttons appear next to the possible answers and everything works fine.  When I run the quiz in our LMS, the radio buttons do not appear.  Anyone else having this issue or have any insight?

    Hi Anjaneai,
    For some clarification, we are loading the Captivate 6 quiz swf into another swf.  When we play the quiz swf alone, the radio buttons appear.  However when we play the quiz swf within the other swf, the radio buttons disappear.  To reiternate, we loaded Captivate 5.5 quiz swfs into another swf and the buttons appeared.  Do you what the difference between the Captivate versions could be or have any insight?
    We've already looked into some of your suggestions (the Flash player is not the issue) and am looking into your other suggestions.  
    Below is the screen shot you requested.
    Thanks again for your assistance.

  • Button not appearing on quiz pass

    Hi All,
    I'm trying to get a button to appear on a quiz when someone passes successfully.  This button will be a link to another .swf file that will pulled into the project in Aggregator.  The link is working fine, but I cannot get the smartshape to appear successfully when the quiz is passed.  I have used the cpInfoPassFail Advanced Action set to greater than 1, visibility is turned off and execute advanced action is set in the Action property box, but still it does not show.  I've working round and round and circles with this all day, trying different advanced actions, visibility on, off... and nothing is working with it.
    If anyone has any suggestions how and why this not working, I'd really appreciate it.  I'm not finding Captivate particularly intuitive at the moment and am seriously considering heading over the Storyline.

    cpInfoPassFail will never be greater than 1; it has only two values: 0 if failed, and 1 if passed. It is a boolean variable.
    When looking at your action: I thought you wanted to open the URL using the shape button, but you put the command Open immediately after showing the shape? That part should be triggered by the shape button. I hope you configured it as a button?
    http://lilybiri.posterous.com/why-i-like-shape-buttons-captivate-6
    Have a look at this blog post, it has a link to a list explaining all system variables.
    http://lilybiri.posterous.com/system-variables-in-captivate-6
    Lilybiri

  • Approve/Reject button not appearing in Email , but present in the notificat

    Hello Friends,
    I am using Po requisition Approval workflow in iProcurement for PR approval.
    One strange thing is happening , that in approval emails Approve/Reject button are not appearing but the same are present in the notification.
    Moreover , some people are getting emails, others are not.
    We have just started setting up the instance for the design prototype , so might be we are missing some setup/steps.
    Please suggest , what steps i am missing. Thanks !!!
    Regards,
    Amit

    Verify that the email preference for the users is not "disabled"
    Have the user login and go to the preferences link at the top.
    OR
    SELECT *
      FROM apps.fnd_user_preferences
    WHERE preference_name = 'MAILTYPE' AND user_name = '&user' Hope this helps
    Sandeep Gandhi
    Independent Techno-functional Consultant

  • Execute button Not appearing in SWI1 Log

    Hi all,
    We are executing a Vendor Workflow i.e is when ever a vendor is created a workflow is triggered and mail is sent for approval.
    There is 2 z tables for agent assignment. It is maintained.
    After creating vendor we can approve it through a mail
    or we can go to Swi1 click the log of that task and inside the log we have a tab Activities.
    in the activities tab we should get buttons Execute,Reject,Create.
    But now we are not getting those buttons inside the log activities tab.
    We verified all the role tables but i dont know wy its not appearing.
    Pls experts help me out with suggestion,
    Awating for ur reply,
    Regards,
    Venkatesh.S

    it looks like your transaction is marked as Easy Web Transaction.
    go to transaction SE93 , enter your transaction and change the radiobutton selection from Easy Web transaction to Professional user transaction and save it.
    run it again, now you can execute from menu->program->execute
    Regards
    Raja

  • HRMS Button not appearing in Work Center

    Hi friend,
    As we have HR module here, we have a requirement of maintaining the Personal number and work center link.
    But in the Transaction code IR01,02,03 HRMS button is not appearing.
    Whether any setting missing especially from HR side anything missing?
    Pls guide me on this.
    Regards,
    krishna

    Hi
    check the config in OIZU transaction, make sure that screen sequence for HR assignment is maintained
    Mneu path:
    PM>>Maintenance Plans, Work Centers, Task Lists and PRTs>Work Centers>Configure Screen Sequence for Work Center
    Regards
    Seenu

  • Delete Button not appearing in cFolders

    Hi All,
    The user is allowed to upload the document in the cFolders. In the screen where the list of files uploaded is displayed, there are buttons like 'Create', 'Copy' etc. But here there is no option to delete the uploaded file.
    Can any one suggest why the 'Delete' Button is not appearing.....
    Thanks in Advance.
    Regards,
    Mary

    Hi ,
    Are you using custom roles?
    Authorization to delete is missing.
    Two ways you could get that :
    1) authorization object CFX_OBJ should have activity 'delete' (06) in your profile
    or else authorization object ACO_SUPER with activity 'Admin' ( not recommended)
    2) Enable  delete authorization via BBP_CFOLDER_BADI method col_authority_change
    regards
    Alok

  • Forward button not appearing in the workflow inbox

    Hi All,
    We have an issue where a user says that the forward button is not appearing in the workflow inbox . This is happening only for one user. Is there an way through which we can add the forward button?
    Regards
    Archana

    Hi Archana,
    If Basis have confirmed that the user has the authorization, then the user should be able to forward tasks.
    Right click on a task in the inbox, it should allow the user to forward the task.
    If the user does not have the authorization, then a message will appear that user does not have authorization to forward tasks.
    Immediately after that take a screen shot of SU53, which will show you why task forwarding is not possible.
    Regards
    Srinivas

Maybe you are looking for

  • Error while creating the HTTP client with destination

    Hi , I am getting this error while connecting to https location on receiver channel . The below error i am getting in SXMB_moni Error while creating the HTTP client with destination The receiver party is doing some security setting on there end and f

  • Unable to open CR2 photos in Photoshop CS3.

    I am unable to open some very important wedding CR2 files in Photoshop CS3. What specific updates do I need to fix this? The raw photoUns were shot on a Canon 70D. The photos were shot in low lighting so I shot in a large format that I don't typicall

  • BUG in acrobat 10.1.1 for mac

    i found a bug in acrobat pro 10.1.1 running on mac osx 10.7.2 whenever i try to zoom by using the "Cmd" + "+" key, the pdf document is rotated 90 degree clockwise instead of zoomin the page like in previous updates (10.0 - 10.1) please fix this bug i

  • When trying to install flash ERROR!

    I have been trying to get flash to work on my computer for over a month. I have tried everything from uninstalling to installing. Changing settings, restoring to an earlier date, you name it I tried it. I was on a chat with HP yesterday for 6 hours -

  • Layout in asset reports

    In asset balances reports I need to view Asset main number text, additional asset description, serial number and inventory number. Is it possible?