Gui is not showing when running program

This source code compiles with no errors in Borland 9, but when I run it, the GUI doesn't show up. I'm clueless, here is the code:
import java.util.Properties;
import javax.mail.internet.*;
import javax.mail.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
public class SimpleSender{
  JPanel jPanel1 = new JPanel();
  JButton jButton1 = new JButton();
  JButton jButton2 = new JButton();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  JLabel jLabel3 = new JLabel();
  JLabel jLabel4 = new JLabel();
  JTextField jTextField1 = new JTextField();
  JTextField jTextField2 = new JTextField();
  JTextField jTextField3 = new JTextField();
  JTextArea jTextArea1 = new JTextArea();
  public SimpleSender() {
    try {
      jbInit();
    catch(Exception e) {
      e.printStackTrace();
  private void jbInit() throws Exception {
    jTextArea1.setText("");
    jTextArea1.setLineWrap(true);
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setBounds(new Rectangle(9, 142, 382, 142));
    jTextField3.setText("");
    jTextField3.setBounds(new Rectangle(56, 99, 170, 22));
    jTextField2.setText("");
    jTextField2.setBounds(new Rectangle(40, 73, 183, 21));
    jTextField1.setText("");
    jTextField1.setBounds(new Rectangle(28, 43, 193, 21));
    jLabel4.setText("MESSAGE:");
    jLabel4.setBounds(new Rectangle(5, 126, 55, 15));
    jLabel3.setText("SUBJECT:");
    jLabel3.setBounds(new Rectangle(5, 102, 51, 15));
    jLabel2.setText("FROM:");
    jLabel2.setBounds(new Rectangle(7, 74, 34, 15));
    jLabel1.setText("TO:");
    jLabel1.setBounds(new Rectangle(9, 45, 20, 15));
    jButton2.setBounds(new Rectangle(88, 6, 77, 25));
    jButton2.setText("RECEIVE");
    jPanel1.setLayout(null);
    jButton1.setBounds(new Rectangle(8, 6, 73, 25));
    jButton1.setText("SEND");
    jButton1.addActionListener(new SimpleSender_jButton1_actionAdapter(this));
    jPanel1.add(jButton1, null);
    jPanel1.add(jButton2, null);
    jPanel1.add(jLabel1, null);
    jPanel1.add(jLabel4, null);
    jPanel1.add(jLabel3, null);
    jPanel1.add(jLabel2, null);
    jPanel1.add(jTextField1, null);
    jPanel1.add(jTextArea1, null);
    jPanel1.add(jTextField2, null);
    jPanel1.add(jTextField3, null);
  public void mail() throws Exception {
      Properties props = System.getProperties();
      // Setup mail server
      props.put("mail.smtp.host", "smtp-server.cfl.rr.com");
      // Get session
      Session session = Session.getDefaultInstance(props, null);
      // Define message
      MimeMessage message = new MimeMessage(session);
      // Set the from address
      message.setFrom(new InternetAddress(jTextField2.getText()));
      // Set the to address
      message.addRecipient(Message.RecipientType.TO,
                           new InternetAddress(jTextField1.getText()));
      // Set the subject
      message.setSubject(jTextField3.getText());
      // Set the content
      message.setText(jTextArea1.getText());
      // Send message
      Transport.send(message);
  void jButton1_actionPerformed(ActionEvent e) {
   try{
     mail();
   }catch(Exception ex){System.out.println("Failed");}
  public static void main(String args[]){
    new SimpleSender();
class SimpleSender_jButton1_actionAdapter implements java.awt.event.ActionListener {
  SimpleSender adaptee;
  SimpleSender_jButton1_actionAdapter(SimpleSender adaptee) {
    this.adaptee = adaptee;
  public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
}

You need to have a JFrame to add your components to.
For example, make your class extend JFrame and set your main panel the ContentPane (assuming that all your components have been added to this panel).
public class SimpleSender extends JFRame {
this.setContentPane(JPanel1);
this.setVisible(true);
}

Similar Messages

  • TS1410 My iPod shuffle ( 1st or 2nd generation) will not recharge and does not show when the doc is connected to my MacBook Pro. I'm running the latest updated version of iTunes.

    My iPod shuffle ( 1st or 2nd generation) will not recharge and does not show when the doc is connected to my MacBook Pro. I'm running the latest updated version of iTunes.

    Hello Jane Benstock,
    Thank you for using Apple Support Communities
    It sounds like the next best step to take would be to reset the iPod Shuffle.
    Check out this article named Resetting iPod shuffle found here http://support.apple.com/kb/HT1655.
    All the best,
    Sterling

  • Why the subvi can not show,when i use call by reference node.

    I used a call by reference node in function pallete,i follow the labview manuals and examples(dynamic load example), but i can not see the subvi show when the program running.
    Attachments:
    comshow.vi ‏75 KB
    交流稳态频谱.vi ‏19 KB

    Hi Sunny,
    Open your subVI,
    1. go to File->Vi Properties (or Ctrl+I)
    2. choose Window Appearance category
    3. choose Customize
    4. check "Show Front Panel When Called" (and "Close Afterwards ..")
    5. save the VI, close it and try again.
    Let us know if it's OK ...

  • Date not showed when report is viewed in PDF .

    Hi,
    We have a text field that shows the date on which the report is running.Date is not showed when report is viewed in PDF.But in HTML we can view them . Can any one help me out?
    Totally there are four pages for the report.

    I have observed the PDF driver iin EPM 11.1.2.x is not up-to-date and technically the Date (Text) is there just like in HTML. However, when you increase the View (Zoom in), it eventually does show up.
    I have chatted with Oracle Support, and they will not address it with a patch for now.

  • How do I enlarge the "presenter notes" window when running my presentation on an external display?

    In the latest version of Keynote, the "Presenter Notes" window is a small horizontal field at the bottom of the presenter's computer screen.  Only 3-4 lines of text can be seen.  This means that when you have a few paragrahs of notes, you have to scroll through them as you are presenting.  This is very cumbersome.  In the previous version of Keynote you could change the relative size of the slides versus the "presenter's notes" boxes when running a presentation on an external display, but in the new version, I can't find a way of enlarging the "presenter's notes" field.
    Also, in the new version, the preview slide doesn't show the initial text on the next slide if that text emerges as a "dissolve in" build when you advance forward through your slides.  I always have the initial text on my slides automatically "dissolve in" after each slide transtion.  But in the new version of Keynote, when in presenter mode, I can't see any of the text on the "next slide."  This makes it difficult to anticipate what slide comes next . . . without going to the Navigator.  Does any one have a solution for this?
    Thank you.

    I figured it out with the help of a post from a few days ago.  Although posted for a different problem, I followed these steps from Cornelia-I and it worked like a charm:
    You can change the link of LR to the images from the network drive to your local drive, best done on parent folder level: right-click the highest folder in library left panel, and choose update storage location. In the opening dialog window point it to your internal folder.

  • Help: Records not showing when cube is placed under the Multiporivider

    Hi Experts,
    I have a Cube called Bcube with char Plant,calm year/month, material and Key Figure, Pqty
    When I generate a report on this Cube, everything looks fine and I see plants, year, etc in the report
    There are 2 other cubes:
    MCube also has char Plant,calyear/month, material and Key Figure: Pqty, Sqty, TQty, AQty
    DCube also has same as BCube: with char Plant,calyear/month, material and Key Figure Pqty
    When I place all three cubes under the multiprovider, the values from the BCube does not show up in reports
    e.g. in a simple report such as
    Row       :  Plant
    Columns:  Pqty, Sqty, TQty, AQty
    In the Multiprovider, under the Indentification of Characteristics, I checked the boxes for all three cubes whenever the same charactertic in all cubes showed up for identification: e.g..
    InfoProvider  InfoObject
    Bcube----
    Plant
    MCube-------Plant
    DCube -
    Plant
    and same for. e.g. 0Calyear
    and same for Key Figures, e.g. I checked all 3 boxes  for PQty which exists in each of the cubes
    1. Why is my data for BCube not showing when reporting against the multiprovider?
    2. what does it mean by checking the 3 boxes for Plant? and checking the 3 boxes for 0Calyear.
    Thanks

    Hi,
    regarding your questions:
    1. When I run listcube against the multiprovider, I only went to the output list to select the fields I needed in the output; then entered the particular cube e.g. BCube in the infoprovider field. That was it (NO other selection) and I got the described results I explained earlier. If you have a specific test for me to try, please let me know.
    2. Please find the settings in both characteristics and key figures for all cubes in the MULTIPROVIDER maintenance screen:
    Characteristic Assighment:
    0calyear -- 3 boxes checked for BCube, DCube & MCube
    Plant -- 3 boxes checked for BCube, DCube & MCube
    0Material-- 3 boxes checked for BCube, DCube & MCube
    Key Figure selection
    PQty-- 3 boxes checked for BCube, DCube & MCube
    Sqty --checked for DCube, this key fig is ONLY in DCube
    TQty--checked for DCube, this key fig is ONLY in DCube
    AQty--checked for DCube, this key fig is ONLY in DCube
    I hope this helps you to guide me.
    Or, were you referring to mappings in the transformations?
    Thanks

  • Hundreds of my iPhoto pictures will not be copied and will not show when I double-click on them.  When I do in iPhoto an exclamation surrounded by a triangle appears.  Though I can see the picture in the small tiles below it will not expand.

    Hundreds of my iPhoto pictures will not be copied and will not show when I double-click on them.  When I do in iPhoto an exclamation surrounded by a triangle appears.  Though I can see the picture in the small tiles below it will not expand.  I also cannot attach any of these pics into an e-mail or into any other file.  I have already went through all 3 Repair options and when that did not solve it went through a complete Rebuild.  Any Help?!  Any Suggestions on how to fix this?!  I have spent almost 2 days now going through all of the published help.
    I have backups going back 6 months - I have not had the real need to check every album before - but - all of my backups also have this same problem.

    The triangle with the ! indicates that the connection between the thumbnail and the orginal is missing - this can be caused by many things including database corruption and user action emoving the originals photos on urpose or by accident
    If the database is corrupted then rebuilding is the solution - backup and depress the option and command keys, launch iPhoto and rebuild your database  --  if the iPhoto rebuild does not cure the problem then download iPhoto Library manager and use its rebuild command which creates a totally new library leaving the existing one untouched
    If you have deleted the photos then you need to start over with a new library and import the photos you have not deleted into it
    You can select one of the problem photos and use the reveal original in finder commander (file menu) to see if the original is there - if it is a finder window will open showing it
    LN

  • My external hard drive does not show when I am trying to open a document in Office Org??

    My external hard drive does not show when I am trying to open a document in Office Org?? When looking in the about IMAC system support it shows as being connected. Any ideas??

    Does the drive show up under 'Devices' in Finder?

  • Preview icon not showing when in thumbnail. (Sketchu

    Hello,
    I recently updated my MBP to Yosemite and installed sketchup on it.
    The preview icon of my sketchup files are not showing when in thumbnail. But as i increase the size of the icon from thumbnail in viewoption i.e from 64px x 64px to 124px x 124px it shows. So my icon is shown as blank without any app logo. Also when i change my view from thumbnail to coverflow or something it shows. Otherthan thumbnail everything works.
    So where is the error in it?
    Please help...
    Thanks
    Amar

    Try the standard fixes:
    - Rest. Nothing is lost
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears. - Restore from backup
    - Restore to factory defaults/new iPod.

  • Battery icon dose not showing when i plug in to usb or power

    battery icon dose not showing when i plug in to usb or power? and not charging when phone is on

    I would try another cable or try the cable in another ios device
    to verify if the cable was broken or your iphones connector is

  • Need to send my back up email a reset security questions email but the option does not show when I click on password and security

    Need to send my back up email a reset security questions email but the option does not show when I click on password and security

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (97456)

  • SAP Gateway- environmental variables not loaded when running brconnect

    Hello
    i have installed the Sap gateway on MSCS
    and the RFC check in sm59  is successful,
    However when i run a job in db13 it fails with "brconnect is not recognized as ......... "
    <sid>adm has all environmental variables set correctly
    SAPService<SID> has them too
    when i run  brconnect on OS level it works fine with <sid>adm and SAPService<SID>
    however if create a brconnect.cmd file where i specify the command as
    SET ORACLE_SID= ....
    SET SAPDATA_HOME=....
    C:\windows\sapcluster\brconnect.exe ...........
    and run it in sm69 it works fine
    Any ideas how to solve this, seems the variables are not taken when running sapxpg
    , i don't want to edit the SDBAC for every  command
    P.S
    set from sm69 returns only the system wide variables, however i have the two systems on this host, and can not make the environmental variables for ORACLE_SID and SAPDATA_HOME system wide as this will cause problem with the other sap system
    Edited by: Yavor Markov on Apr 12, 2010 6:07 PM

    Hi Markov,
    Can you tell us with which user id you have installed SAP as well as check the sap services are running with which user id, if it is not <sid>adm then you have to check the environment variables of that user.
    Also you can try adding c:\windows\sapcluster in PATH environment variable.
    Regards,
    Kishore Soma

  • My control center and notification center are not showing when I swipe in there respective locations. Does anybody know why?

    My control center and notification center are not showing when I swipe in there respective locations. Does anybody know why?

    Thank you for the sugestion, but it was working fine both on the lock screen and on my home screen. I check all my settings and it is how it was from Friday, when I got the iPhone 5s. It just stop working.  The only way I can fix it is by shutting down the phone. It will work for a while, then it won't. 

  • RE: my input fields does not display when running the page

    my input fields does not display when running the page
    why is that so?

    Hi,
    Can you send the HTML code for us?
    Afonso

  • Hello, the "sign" feature does not show when i open a pdf document with reader (MAC)

    Hello, the "sign" feature does not show when i open a pdf document with reader (MAC)

    Hi mentane,
    Thank you for posting on the Adobe forums, what is the version of Adobe Reader you are working with.
    Open Adobe Reader>Adobe Reader>about Adobe Reader.
    Thanks,
    Vikrantt Singh

Maybe you are looking for