GUI doesnt pop-up when program runs

cant seem to find why my GUI doesnt show up when i run my program?....i believe i am missing one statement or two but i searched everywhere...and tried a few methods in the Container class, and found nothing....thanks in advance
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
import java.io.*;
public class GUI extends JFrame implements ActionListener
ReadLevel read;
private JLabel input = new JLabel ("Location of Input File:");
private JLabel output = new JLabel ("Location of Output File:");
private JLabel size = new JLabel ("Minimum word size:");
private JLabel freq = new JLabel ("Minimum word frequency:");
private JLabel total = new JLabel ("Total number of words:");
private JLabel totalSize = new JLabel ("Total number meeting size requirement:");
private JLabel totalFreq = new JLabel ("Total number meeting frequency requirement:");
private JLabel avgSize = new JLabel ("Average size meeting size requirement:");
private JLabel avgFreq = new JLabel ("Average frequency meeting frequency requirement:");
private JLabel most = new JLabel ("Three most frequent words meeting all requirements:");
private JTextField in = new JTextField(10);
private JTextField out = new JTextField(10);
private JTextField sz = new JTextField(5);
private JTextField fq = new JTextField(5);
private JTextField tt = new JTextField(10);
private JTextField ts = new JTextField(5);
private JTextField tf = new JTextField(5);
private JTextField as = new JTextField(5);
private JTextField af = new JTextField(5);
private JTextField m1 = new JTextField(10);
private JTextField m2 = new JTextField(10);
private JTextField m3 = new JTextField(10);
private JButton submit = new JButton("Submit");
private JButton clear = new JButton("Clear");
private JButton printInput = new JButton("Print InPut");
private JButton printOutput = new JButton("Print Output");
private ReadLevel myReadLevel;
public GUI()
super("Reading Levels");
read = new ReadLevel(in.getText(), sz.getText(), fq.getText()); <-----this gives me an compiler error...and i dont know why..seems correct and in the correct place, isnt it?
submit.addActionListener(this);
clear.addActionListener(this);
printInput.addActionListener(this);
printOutput.addActionListener(this);
JPanel row1 = new JPanel();
row1.setLayout(new BoxLayout(row1, BoxLayout.X_AXIS));
row1.add(input);
row1.add(in);
JPanel row2=new JPanel();
row2.setLayout(new BoxLayout(row2, BoxLayout.X_AXIS));
row2.add(output);
row2.add(out);
JPanel row3=new JPanel();
row3.setLayout(new BoxLayout(row3, BoxLayout.X_AXIS));
row3.add(size);
row3.add(sz);
JPanel row4=new JPanel();
row4.setLayout(new BoxLayout(row4, BoxLayout.X_AXIS));
row4.add(freq);
row4.add(fq);
JPanel row5=new JPanel();
row5.setLayout(new BoxLayout(row5, BoxLayout.X_AXIS));
row5.add(total);
row5.add(tt);
JPanel row6=new JPanel();
row6.setLayout(new BoxLayout(row6, BoxLayout.X_AXIS));
row6.add(totalSize);
row6.add(ts);
JPanel row7=new JPanel();
row7.setLayout(new BoxLayout(row7, BoxLayout.X_AXIS));
row7.add(totalFreq);
row7.add(tf);
JPanel row8=new JPanel();
row8.setLayout(new BoxLayout(row8, BoxLayout.X_AXIS));
row8.add(avgSize);
row8.add(as);
JPanel row9=new JPanel();
row9.setLayout(new BoxLayout(row9, BoxLayout.X_AXIS));
row9.add(avgFreq);
row9.add(af);
JPanel row10=new JPanel();
row10.setLayout(new BoxLayout(row10, BoxLayout.X_AXIS));
row10.add(most);
JPanel row11=new JPanel();
row11.setLayout(new BoxLayout(row11, BoxLayout.Y_AXIS));
row11.add(m1);
row11.add(m2);
row11.add(m3);
JPanel row12=new JPanel();
row12.setLayout(new BoxLayout(row12, BoxLayout.X_AXIS));
row12.add(submit);
row12.add(clear);
row12.add(printInput);
row12.add(printOutput);
Container myContent = getContentPane();
myContent.setLayout (new BoxLayout (myContent, BoxLayout.Y_AXIS));
myContent.add (row1);
myContent.add (row2);
myContent.add (row3);
myContent.add (row4);
myContent.add (row5);
myContent.add (row6);
myContent.add (row7);
myContent.add (row8);
myContent.add (row9);
myContent.add (row10);
myContent.add (row11);
myContent.add (row12);
setContentPane(myContent);
public void actionPerformed(ActionEvent ev)
read(in.getText(), sz.getText(), fq.getText()); <----this gives me errors
if(ev.getSource() == submit);
read(in.getText(), sz.getText(), fq.getText()); <----this too
if(ev.getSource() == clear);
in.setText("");
out.setText("");
sz.setText("");
fq.setText("");
tt.setText("");
ts.setText("");
tf.setText("");
as.setText("");
af.setText("");
m1.setText("");
m2.setText("");
m3.setText("");
if(ev.getSource() == printInput);
if(ev.getSource() == printOutput);
read.asString(); <---and this
public class Driver
public static void main (String[] args)
GUI myGUI = new GUI();
myGUI.setDefaultCloseOperation(myGUI.EXIT_ON_CLOSE);
myGUI.pack();
myGUI.show();
myGUI.toFront();
myGUI.setVisible(true);

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
import java.io.*;
public class GUI extends JFrame implements ActionListener
ReadLevel read;
private JLabel input = new JLabel ("Location of Input File:");
private JLabel output = new JLabel ("Location of Output File:");
private JLabel size = new JLabel ("Minimum word size:");
private JLabel freq = new JLabel ("Minimum word frequency:");
private JLabel total = new JLabel ("Total number of words:");
private JLabel totalSize = new JLabel ("Total number meeting size requirement:");
private JLabel totalFreq = new JLabel ("Total number meeting frequency requirement:");
private JLabel avgSize = new JLabel ("Average size meeting size requirement:");
private JLabel avgFreq = new JLabel ("Average frequency meeting frequency requirement:");
private JLabel most = new JLabel ("Three most frequent words meeting all requirements:");
private JTextField in = new JTextField(10);
private JTextField out = new JTextField(10);
private JTextField sz = new JTextField(5);
private JTextField fq = new JTextField(5);
private JTextField tt = new JTextField(10);
private JTextField ts = new JTextField(5);
private JTextField tf = new JTextField(5);
private JTextField as = new JTextField(5);
private JTextField af = new JTextField(5);
private JTextField m1 = new JTextField(10);
private JTextField m2 = new JTextField(10);
private JTextField m3 = new JTextField(10);
private JButton submit = new JButton("Submit");
private JButton clear = new JButton("Clear");
private JButton printInput = new JButton("Print InPut");
private JButton printOutput = new JButton("Print Output");
private ReadLevel myReadLevel;
public GUI()
super("Reading Levels");
read = new ReadLevel(in.getText(), Integer.parseInt(sz.getText()), Integer.parseInt(fq.getText())); //<-----fix it
submit.addActionListener(this);
clear.addActionListener(this);
printInput.addActionListener(this);
printOutput.addActionListener(this);
JPanel row1 = new JPanel();
row1.setLayout(new BoxLayout(row1, BoxLayout.X_AXIS));
row1.add(input);
row1.add(in);
JPanel row2=new JPanel();
row2.setLayout(new BoxLayout(row2, BoxLayout.X_AXIS));
row2.add(output);
row2.add(out);
JPanel row3=new JPanel();
row3.setLayout(new BoxLayout(row3, BoxLayout.X_AXIS));
row3.add(size);
row3.add(sz);
JPanel row4=new JPanel();
row4.setLayout(new BoxLayout(row4, BoxLayout.X_AXIS));
row4.add(freq);
row4.add(fq);
JPanel row5=new JPanel();
row5.setLayout(new BoxLayout(row5, BoxLayout.X_AXIS));
row5.add(total);
row5.add(tt);
JPanel row6=new JPanel();
row6.setLayout(new BoxLayout(row6, BoxLayout.X_AXIS));
row6.add(totalSize);
row6.add(ts);
JPanel row7=new JPanel();
row7.setLayout(new BoxLayout(row7, BoxLayout.X_AXIS));
row7.add(totalFreq);
row7.add(tf);
JPanel row8=new JPanel();
row8.setLayout(new BoxLayout(row8, BoxLayout.X_AXIS));
row8.add(avgSize);
row8.add(as);
JPanel row9=new JPanel();
row9.setLayout(new BoxLayout(row9, BoxLayout.X_AXIS));
row9.add(avgFreq);
row9.add(af);
JPanel row10=new JPanel();
row10.setLayout(new BoxLayout(row10, BoxLayout.X_AXIS));
row10.add(most);
JPanel row11=new JPanel();
row11.setLayout(new BoxLayout(row11, BoxLayout.Y_AXIS));
row11.add(m1);
row11.add(m2);
row11.add(m3);
JPanel row12=new JPanel();
row12.setLayout(new BoxLayout(row12, BoxLayout.X_AXIS));
row12.add(submit);
row12.add(clear);
row12.add(printInput);
row12.add(printOutput);
Container myContent = getContentPane();
myContent.setLayout (new BoxLayout (myContent, BoxLayout.Y_AXIS));
myContent.add (row1);
myContent.add (row2);
myContent.add (row3);
myContent.add (row4);
myContent.add (row5);
myContent.add (row6);
myContent.add (row7);
myContent.add (row8);
myContent.add (row9);
myContent.add (row10);
myContent.add (row11);
myContent.add (row12);
setContentPane(myContent);
public void actionPerformed(ActionEvent ev)
read(in.getText(), sz.getText(), fq.getText()); //<----where the 'read' function come from??
if(ev.getSource() == submit);
read(in.getText(), sz.getText(), fq.getText()); //<----There is no 'read' function in your code
if(ev.getSource() == clear);
in.setText("");
out.setText("");
sz.setText("");
fq.setText("");
tt.setText("");
ts.setText("");
tf.setText("");
as.setText("");
af.setText("");
m1.setText("");
m2.setText("");
m3.setText("");
if(ev.getSource() == printInput);
if(ev.getSource() == printOutput);
read.asString(); //<---Where does the 'asString' function come from???!?
}

Similar Messages

  • IMessages for Mac question: stop message pop-up when not running?

    How do I keep messages from popping up when the program is not running? Not awesome when projecting from my laptop to large groups and the loving wife sends the shopping list.

    go into your notifications panel in system prefs and turn off the notifications for the messages application that should resolve the issue!

  • Why does (the object "move" is currently not availible) dialoge box pop up when I run action script?

    when I run actions in CS6 it does nothing close to what Ive recorded , "move" dosnt work, "reflect" dosnt work  ,"copy" dosnt work ? and when I record simple moves it places shapes in compleately different areas then where I recorded them Ive try'd breaking the set up into the smallist possible actions ,with function keys and without . Ive try'd reconfigureing all types of presets in all sorts of combo's its driveing me nuts can anyone esplain ?!?!?

    my first command is "open" and it opens my file  my second command is copy and the first dialog box opens and states that ( the object "copy" is not currently available ) and as long as its still in the clipboard from building the action after i hit continue it pastes the two objects it said the copy wasn't currently available for ...if the clip board is loaded with other stuf two of those pop up instead, next command is rectangle tool witch seems to work but where I record it is not where it shows up when i play back its in different areas everytime time i play back ,then the next command is shapemodes "crop" function witch cropped ounce then not but left the object i was cropping in lines view instead of pixel preview and rite now it just has the rectangles i made appear with solid white and a black stroke but when i recorded my little rectangles were clear with a small black stroke they're also way off to the side on playback ,then the second dialog box pops up and tells me that the object  (?)"reflect" is also currently unavailable but it doesn't matter because they're white anyway's ..... any ways it goes on like that ,I have plenty of time between moves to let the program think.... 

  • Layout Change when program run in background.

    Hi All,
    I have a layout field on the selection screen. When I run the program in foreground, iam able to see the change in the layout in the output. When I select a layout name and run the report in background, Iam sending a file to the application server. Now, when I give the layout and run the report in background, the file iam sending to the app server should have the same layout which i have selected in the selection screen.
    Please help with some example code.
    Thanks,
    Guru Charan.

    Hi Amit,
    Thanks for the reply. The program can be run both the ways. When it is run in the foreground, Iam changing the layout with the help of REUSE_ALV_GRID_DISPLAY. It is working.
    But when iam running in the background, I have to send a file to application server with the same layout.
    thanks,
    Guru Charan.

  • "GUI Download" not working if program run background

    Dear All,
    I`ve created program to download my internal table using function module GUI_DOWNLOAD and it works fine if run foreground. The problem is now when the program run background it didn`t work and got error "Could not ascertain code page".
    Or maybe somebody hv another idea  how to download that data to frontend drive but the program should run background.
    thks

    hi..
    Hope this this will be helpful.
    DATA : v_transfer_record(950) TYPE c,
           vfl_file LIKE LINE OF itab.
    OPEN DATASET file_name FOR OUTPUT IN TEXT MODE
             ENCODING DEFAULT.
      IF sy-subrc = 0.
        LOOP AT itab INTO vfl_file.
          CLEAR v_transfer_record.
          v_transfer_record =  vfl_file.
          TRANSFER v_transfer_record TO file_name.
        ENDLOOP.
        CLOSE DATASET file_name.
        IF sy-subrc <> 0.
          MESSAGE 'Error Closing dataset'.
          EXIT.
        ELSE.
          MESSAGE 'records in file file_name.
        ENDIF.
      ELSE.
        MESSAGE 'error openning file for output' .
        EXIT.
      ENDIF.
    Regards,
    Pranali

  • HT5163 sim doesnt pop out when i use the paperclip for my iphone5

    My SIM card won't pop out when I use the paper clip, not sure what to do. I cant get it to respond to itunes, it said could not detect device.   I have a "locked SIM" on top of phone. Yes it was a crazy weekend.  (but fun)

    It is a bit of an angle to eject it and you have to push hard. If your weekend included immersing your iPhone in liquid it could be even a bit harder.

  • My contacts names doesnt pop up when they call

    my contacts doenst pop p when they call

    For names to appear on the screen of the phone when calls are received, the carrier has to support caller ID, and the caller ID information has to match what is saved in the contact exactly. If this is not working, you will not see the name.
    Not sure what you are asking regarding SIM icon.

  • I occasionally get error messages popping up when I run Firefox 7. The messages often say "Exc in ev handl: TypeError: oSAPlg.oRoot.log is not a function". does anyone know how to fix this?

    After I downloaded and installed the latest version of Firefox, I started getting these error messages every so often when I launched the browser. These messages will usually pop up every third time or so I open the browser and pop up on every page, sometimes multiple times, and I have to clear them away before I can do anything on the page. The message usually reads "Exc in ev handl: TypeError: oSAPlg.oRoot.log is not a function". Is there any thing we can do to fix this?

    Please see solution in http://kb.mozillazine.org/Problematic_extensions
    for "McAfee Site Advisor".
    (Windows): For best results you should uninstall '''McAfee Site Advisor''' from Control Panel > add/change programs (Programs and Features). Reboot the system. Then Reinstall from http://www.siteadvisor.com/ and reboot the system. When installing refuse other suggested (crapware) applications.
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • File generated when program run in background

    Hi,
    I have program that generates a report & all the data in the report output is down loaded to a file .please somebody make it clear:
    if I run the report in background will the file still be generated.
    thanks,
    reddy.

    Hi,
    If the program has logic to transfer the data to appliacation layer, then it works. Other wise it is not possible to download the data into your desktop by running in Background.
    Regards,
    Ashok

  • When program runs thru T-code , it exits

    I have a very awkward situation. the program works exceptionally well. But now that i have created a t-code for the same the selection-screen shows up, but when i try to execute in comes out of the program.
    i tried to debug, it works untill start-of-selection, but terminates and come out after start-od-selection.
    any ideas  how to fix this problem???

    Hi
    Try to check the type you've assigned to your transaction, it has to be:          
    - Program and selection screen (report transaction)
    Probably you've assigned the type for module pool: Program and screen (dialog transaction)     
    Max

  • Withholding taxes not updated when program run in background

    Hi,
    in a z1 report i do:
      SUBMIT z2
      VIA JOB lc_jobname
       NUMBER v_jobcount
         WITH p_fecha  = p_fecha                               
         WITH p_file   = v_file_in
         WITH p_e_file = p_efile 
         WITH p_client = p_client
         WITH p_test   = p_test  
          AND RETURN.
    within this z2 report i do:
              PERFORM mrm_invoice_create_call(saplmrm_bapi)     USING     s_rbkpv
                                                           tab_frseg[]
                                                           tab_co[]
                                                           tab_ma[]
                                                           c_rbstat_posted
                                                           space
                                                 CHANGING  invoicedocnumber
                                                           fiscalyear
                                                           return[]
                                                           f_subrc.
              IF test IS INITIAL.
                COMMIT WORK AND WAIT.
              ELSE.
                ROLLBACK WORK.
              ENDIF.
    the question is that if i run z1 report online there is no problem but if
    i run z1 report in background, withholding taxes are not calculated.
    After debugging this is what i´ve found out:
    1.- in PERFORM mrm_invoice_create_call(saplmrm_bapi) there is a call to fm FI_WT_POST IN UPDATE TASK
    2.- in FI_WT_POST table WITH_ITEM is updated
    i guess this could be due to a delay in updating the table so i´m considering doing a WAIT UP TO X SECONDS.
    why is it working in online mode but not in background mode?
    any idea?
    Best regards.

    Hi,
    in case someone is interested this is how i solved the question:
    i had badi MRM_WT_SPLIT_UPDAT implemented.
    in this badi implementation i had this code (among other checks too):
    CHECK sy-tcode = 'MIR4' OR sy-tcode = 'MIR7'.
    this code avoided the background job case.
    It seems that In a background job sy-tcode is empty.
    so i just needed to add this:
    CHECK sy-tcode = 'MIR4' OR sy-tcode = 'MIR7' OR  sy-batch = 'X'.
    and then withholding taxes reappeared again.
    (so sad, so true... one day of debugging,  sigh)
    Best regards.
    Edited by: Pablo Casamayor on Feb 2, 2012 4:53 PM

  • Front panel of a vi pops up when i start my top level vi how can i stop this

    i have a vi that whos front panel should display when the user clicks a front panel button(test instructions),
    however this vi pops up when i run the top level vi. I can manually close the vi, but how do i stop this?
    i tried modifying the Sub VI Set up properties, but that doesnt work.
    Solved!
    Go to Solution.

    Hi jknapp,
    As egraham has pointed out, you can customize the window appearance of your sub VI from the VI Properties.  If you go to File » VI Properties, then under Category select Window Appearance and then Customize..., you should be able to control how the sub VI appears.  Hope this helps!
    Taylor G.
    Product Support Engineer
    National Instruments
    www.ni.com/support

  • Firefox hangs and will not allow me to access other programs running when I resize a pop up window, move a pop up window, accidentally right click flash content.

    Firefox hangs and will not allow me to access other programs running when I resize a pop up window, move a pop up window, accidentally right click flash content.
    == This happened ==
    A few times a week
    == Not sure when it statrted

    Hi.
    When this happens, please press CTRL+SHIFT+ESC and see how much RAM and CPU Firefox is using. If they're sky high, then... Well, that kind of issues are, unfortunately, more common and the we'd like. Thankfully, 99% of the cases are very easy to solve. However, you do need to diagnose what your exact problem is. Do this:
    #run Firefox in safe-mode to disable all extensions and plugins. If this fixes your issues, be them with RAM or CPU usage, then you know it's a problem with plugins or extensions. Proceed to number 2. If safe-mode doesn't fix the issues, then read bellow, after this list;
    #update all extensions and plugins in your Firefox. If this doesn't solve the issues, proceed to the following number;
    #disable all extensions and plugins in your Firefox (not running safe-mode). Being certain that, as in safe-mode, the problems you're having have gone away, enable one plugin at a time. You should be certain that you WANT that plugin to be enabled, so keep your overall number of plugins as low as possible. When you encounter the problems, you know you've found a problematic plugin, so disable it for good. Keep enabling all plugins (except problematic ones) until you've gone through them all.
    #enable one extension at a time. Again, be certain that you WANT that extension to be enabled, so keep your overall number of extensions as low as possible. When you encounter the problems, you know you've found a problematic extension, so disable it for good. Keep enabling all your extensions (except problematic ones) until you've gone through them all;
    #you're done! You've fixed your problems with problematic add-ons.
    Ok, if disabling all extensions and plugins through safe-mode didn't work to bring Firefox's CPU and RAM usage to good levels, then you have different issue. The most likely scenario is that you have a third party software running on your computer that is messing with Firefox. Do as follows:
    #do a virus/malware check on your computer. If this doesn't fix it, proceed;
    #disable all software running in the background that you don't want to have running in the background (in windows, this is done by pressing WINDOWS+R in your keyboard, typing "msconfig" (without the commas) and pressing enter. Now, under the "Startup" tab, you can uncheck the software you don't want, and reboot your system for changes to take effect. If you're unsure of what software you want running, ask someone with more experience). If this doesn't fix you issues with Firefox, proceed;
    #check your firewall/antivirus/security suite for enabled functions/features that you don't want and/or may be conflicting with Firefox. You'll find that these features are most likely tied to Internet Security features, such as link scanners or URL checkers and the like. If you're not sure they are conflicting with Firefox, simply try to disable to see whether or not that's true. As long as you don't browse the web with your antivirus completely off and your firewall completely turned off, there should be no problems. If this doesn't solve the issues, proceed to the following number;
    #check your operating system security options, mainly advanced options that are not configured by default. While it's very unlikely that this may be the cause of the problem (after all, it's the last item on the list), it's remotely possible. If this doesn't do it, I'm out of ideas. Except make sure you've followed my instructions correctly.

  • Always pop-up  error mesage when i run the cd-rom program

    Always pop-up  error mesage when i run the cd-rom program - Macromedia Projector發生問題,必須關閉,謹此致歉

    You need to disable "Autoplay" for your CD drive. In the Control Panel under Hardware.

  • 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);
    }

Maybe you are looking for

  • In Yosemite, dropping files in and out of folders on my desktop causes a freeze.  Must relaunch the finder window.

    After the first few days of operating my new computer, Yosemite began to develop strange glitches. I tried to drag a folder from a Finder window. It zoomed upward on Desktop and stayed where it stopped—and nothing worked. Everything froze. The cursor

  • Making of fields mandatory in Material Master

    Dear Gurus I am working on ECC 5.0 I wanted to make mandatory fields for  material master in some of the views .. How to do that activity , can anyone give the clear cut idea about this how to do Thanx in advance Rgds Surya

  • Acrobat 9 Pro and LiveCycle

    I have Acrobat 9 pro now and for some reason it won't show up in the preview window in LC now. Do you know why?

  • Telephone number in address

    Hi all,   i am displaying the vendor address in PO form by passing the address number to the address node in smart form. My problem is communication details like Telephone number, Fax and email id is not printing in the output. I want to print the co

  • Vikas Application page view

    Hi , Anyone know the access details for 'guest' for VIKASA workspace.I had this several months ago but right now i can see the application on : http://htmldb.oracle.com/pls/otn/f?p=24317 But the guest/guest is not working . I need to view the page de