Exit and Reset Buttons

Hi i'm trying to make the exit and reset buttons work.
Everything works exept for these two and I do'nt understand why.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class PuntenInterface extends JFrame implements ActionListener{
    private JPanel panelknop = new JPanel(new GridLayout(4,1));
    private JButton knop1 = new JButton("Punt1");
    private JButton knop2 = new JButton("Punt2");
    private JButton knop3 = new JButton("Punt3");
    private JButton knop4 = new JButton("Teken");
    private JPanel paneltext = new JPanel(new GridLayout(1,4));
    private JTextField textveld1 = new JTextField();
    private JTextField textveld2 = new JTextField();
    private JLabel xcoord = new JLabel("X-Coordinaat: ");
    private JLabel ycoord = new JLabel("  Y-Coordiaat: ");
    private JPanel coordinaten = new JPanel(new GridLayout(4,1));
    private JLabel coordp1 = new JLabel();
    private JLabel coordp2 = new JLabel();
    private JLabel coordp3 = new JLabel();
    private JLabel geef = new JLabel("Geef de coordinaten van de drie punten in:");
    private JPanel quit = new JPanel(new GridLayout(1,3));
    private JButton reset = new JButton("Reset");
    private JButton exit = new JButton("Quit");
    private JPanel tekening = new JPanel();
               Punt p1 = new Punt(0, 0);
               Punt p2 = new Punt(0, 0);
               Punt p3 = new Punt(0, 0);
    public PuntenInterface(){
          setTitle("PuntenInterface");
          setBounds(500,500,800,800);
          Container c = getContentPane();
                c.setLayout(null);
          panelknop.setBounds(50,30,100,400);
                c.add(panelknop);
                panelknop.add(knop1);
                panelknop.add(knop2);
                panelknop.add(knop3);
                panelknop.add(knop4);
                paneltext.setBounds(160,30,300,30);
                c.add(paneltext);
                paneltext.add(xcoord);
                paneltext.add(textveld1);
                paneltext.add(ycoord);
                paneltext.add(textveld2);
                knop1.addActionListener(this);
                knop2.addActionListener(this);
                knop3.addActionListener(this);
                knop4.addActionListener(this);
                coordinaten.setBounds(160,80,400,100);
                c.add(coordinaten);
                coordinaten.add(geef);
                coordinaten.add(coordp1);
                coordinaten.add(coordp2);
                coordinaten.add(coordp3);
                quit.setBounds(160,450,200,30);
                c.add(quit);
                quit.add(reset);
                quit.add(exit);
                tekening.setBounds(160,150,400,400);
                setVisible(true);
public void actionPerformed(ActionEvent e){
        int x = 0;
        int y = 0;
        String sx = textveld1.getText();
        if (!sx.equals("")){
            x = Integer.parseInt(sx);
            textveld1.setText("");
        String sy = textveld2.getText();
        if (!sy.equals("")){
            y = Integer.parseInt(sy);
            textveld2.setText("");
        Object source = e.getSource();
        if (source == knop1){
            p1 = new Punt(x,y);
        else if (source == knop2){
             p2 = new Punt(x,y);
        else if (source == knop3){
              p3 = new Punt(x,y);
        else if (source == knop4){
            Puntenframe3 pf = new Puntenframe3(p1,p2,p3);
        if (source == knop1){
            int Coordinaat1 = Integer.parseInt(sx);
            int Coordinaat2 = Integer.parseInt(sy);
            coordp1.setText("X-Coordinaat punt 1:  " + Coordinaat1 + " ,Y-Coordinaat punt 1:  " + Coordinaat2);
            else if (source == knop2){
            int Coordinaat3 = Integer.parseInt(sx);
            int Coordinaat4 = Integer.parseInt(sy);
            coordp2.setText("X-Coordinaat punt 2:  " + Coordinaat3 + " ,Y-Coordinaat punt 2:  " + Coordinaat4);
            else if (source == knop3){
            int Coordinaat5 = Integer.parseInt(sx);
            int Coordinaat6 = Integer.parseInt(sy);
            coordp3.setText("X-Coordinaat punt 3:  " + Coordinaat5 + " ,Y-Coordinaat punt 3:  " + Coordinaat6);
        if (source == reset){
        textveld1.setText("");
        textveld2.setText("");
        coordp1.setText("");
        coordp2.setText("");
        coordp3.setText("");
        if (source == exit){
            System.exit(0);
}Thanks very much

Take your knop1 button for example. What do you do with that button that you're not doing with your reset button?
Hint: action listener.

Similar Messages

  • How to get the submit and Reset buttons on bottom of the page?

    while viewing a parametric form in the web browser i get SUBMIT
    and RESET buttons on the top of the form which doesnt look good.
    I tried pasting the whole html available by default in the
    Before Form Value(where the submit and reset buttons are
    defined) in the After Form Value property of the report property
    pallette. Though the layout appears as i wanted but its not
    passing the parameters values to the query but generates an
    error " REP-0788 Warning : The value of restricted LOV parameter
    BV_FROM_DATE is not among the selected values.". What can be the
    solution to this problem? Your Help is much appreciated. And
    also the report generated in the Runtime Previewer shows all the
    colors of the fields but its not shown on the web browser where
    can i define them...Your Help!!!!Thank you very much in
    advance..

    when you select 'list of values for the parameters' there is a choice box that says 'restrict list to Predetermined values'. Don't select it. This will solve your first problem.
    Second:When you run the report on the web you must choose ' desformat=htmlcss' then you can display the report as in the preview window. But still you can't see the same view in the web browser on report builder. It is still not good. As I sad before you can see the right view when publishing on the web.

  • How can I make easier case structure? Or can it possible to have one Pause and reset button in same structure.??

    hello,
    I am tring to convert my main test vi in case structure so latter on i can make some changes in that for example i want creat one pause button and reset button in that.
    I am not so much familer with case structure i want your guidence that how can i make my vi in globle case stucture in that i m having case 1 ,case 2...
    i already tried for that but then i got confused.
    here i am attaching my .llb file in that aa.vi is my main testing vi.
    will you plese guide me so i can make confort vi in case structure.
    Or can it possible to have one pause button and one reset button in same stucture,so User can pause or reset execution at any time when they want.
    Thank you very much in advance.
    Attachments:
    aa.llb ‏3338 KB

    Hello,
    I have change my entire structure ,now is it possible to have pause and reset button.
    here i have attached my changed vi.
    if still any changes required then please suggest me.
    Thank you.
    Attachments:
    aa.vi ‏75 KB
    aa1.llb ‏3333 KB

  • Reg: save exit and cancel buttons

    Hi,
    In normal report programs when we enable the back , exit and cancel buttons they work fine without writing any code.but its not in the case of Module pool why?
    In thr normal reports where does the code come from?
    regards
    prasanth

    Hi....
    Module pool programs is nothing but screen flow + reports...
    Here we designing the screens....
    So we hav to to give every functionality.. for all buttons and menu items of the appeared screen...
    Where as in reports...,
    We are just using the standard screen (sellection screen and list output screen ) s mostly...,
    Here also some times we hav to go for created screens.. nothing but.... interactive reports...,
    There we need to give again all those functionalities...
    And..,
    To see the BACK button logic and other logics in the reports...,
    Ex: PAI event of SAPLWBABAP program..., 
    You can find that name with...
    By giving /H and enter before ur action...
    Thanks,
    Naveen.I

  • Need reset box with flip-flop green LED and reset button

    Before I build up a large number of these, is there an off-the-shelf box with flip-flop green LED and reset button?

    Hi,  I'm not sure what you mean.  Are you looking for a phsyical project box witha built in reset switch and LED?  Or are you talking about a LabVIEW template?
    Chris Bakker
    National Instruments
    Applications Engineer
    Check out LabVIEW 2009 and the New X-series DAQ!

  • Problem with SAVE and RESET button in WAD

    Hi all,
    We have two queries embedded in save template and we have created two different save and reset buttons for each query. But if i execute save or reset for one query it is working for both the queries. Can i restrict the SAVE and RESET button for a particular query.

    Hi Tilak,
         It appears that though there are two reset buttons, the HTML code for the webtemplete is not arranged to restrict the reset function of the button for each dataprovider used. This may cause the reset function to act globally on all dataproviders . In the XHTML code, please pass a unique instruction to each reset function, such that each instruction corresponds to a unique dataprovider.
    Thanks,
    Nithin Reddy

  • Submit and Reset Buttons in oracle Reports Previewer

    Hi....
    When i generate a report from Form 10g it displays Parameter previewer....
    It shows submit and reset button in the top and then list the other paramet values...
    Now my client wants the submit button and reset button after the list of parameters not in the top.
    As i am new to oracle 10g can anyone help me....
    plz direct me to the forum if it is discussed earlier...
    Thanx in advance....

    Hello,
    The HTML displaying the Submit and Reset buttons is defined in the "Before Form Value property" :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_rpesc_before_form_value.htm
    You can move the HTML code to the property "After Form Value property"
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_rpesc_after_form_value.htm
    in order to display these buttons at the bottom of the parameter form page ...
    Regards

  • Send and reset buttons won't work on contact form

    Hey, I'm using Flash CS3 and ActionScript 2. I've created a simple contact page, inside a movie clip (because I got it fading in and out), I've put the script on the main timeline, so not inside the movie, but the send and reset buttons won't respond all. I've checked the instance names and spellings are correct, here's the script I'm using:
    contact_tween.send_button.onPress = function() {
             if (name eq "" or subject eq "" or message eq "" or email eq "") {
                   stop();
             } else {
             loadVariablesNum("form.php", 0, "POST");
             gotoAndPlay(211);
    contact_tween.reset_button.onPress = function() {
         name="";
         subject="";
         message="";
         email="";
    so, what am I doing wrong? any help appreciated, thanks.
    ps. contact_tween is the name of movie I created to fade the whole contact page in and out.

    ok, i've got the send button working, it was the script on the keyframe that controls the contact form, i copied the code from an older version of the contact file where the send button works. i've checked all the frames, and made sure there aren't any unnecessary instance names, duplicate or otherwise. only thing is the reset button still doesn't work.
    another thing i'm not sure of, do i need to upload the swf and php files to a server, or should i be able to get a test email in my inbox if i test it from my computer without uploading?

  • Differences between 'Cancel' , 'Exit' and 'Back' buttons in a dialog prog.

    Hi all,
    I have a straightforward questions about handlign the Cancel, Exit and Back buttons in a dialog program. What is the way of handling these function codes? I guess with 'Exit'  we leave the transaction using command 'Leave Program',  with 'Back' we can use 'Leave to screen 0' . Right? What about Cancel command?
    Regards,
    Sükrü

    hi
    good
    CANCEL->Cancel the Current Session back to exactly last session
    EXIT->Exit From the current session and back to main session
    BACK->Back to the exactly the last session
    thanks
    mrutyun^

  • Windows 8.1 apps exit and minimize buttons

    The close and minimize buttons disappear after 3 seconds in windows 8.1 apps and don't come back i used alt+tab to exit the app 
    does anyone know how to fix this

    Hi n_man2000,
    You need to move your mouse to the top of the screen and then click the
    Close button in the title bar.
    For more information about how to close an APP in Windows 8.1, please check:
    How do I close an app?
    If I misunderstand something, please let me know.
    Best regards
    Michael Shao
    TechNet Community Support

  • LMS 4.2.1: Save and Reset Button not woking on Syslog Purge Settings page

    Hello,
    Did anyone notice that Save button is not woking on Syslog Purge Settings page  (Admin > Network > Purge Settings > Syslog Purge Settings) when Email: field is not empty. An Reset button is not working at all.This is the Cisco Prime LMS 4.2.1.
    Is it only my LMS server or you all have this bug?
    Regards,
    Marija

    I did a test on a system (LMS 4.2.1, W2k8 R2) and had the same issue, so this really looks like a bug in the GUI;

  • Update and Reset Button

    HI Experts
    I am using given bellow code to Edit Employee data. i dont know how to update this data and go back to Brose Form and want also place ReSet Button
    i know i can easily do that using DataEdit Tag but using DataEdit Tag i am not been able to customize data entry
    The Code is
    <body>
    <h2>Employee Edit Form</h2>
    <jbo:ApplicationModule id="Bssbc4jModule" definition="BSSJSP.Bssbc4jModule" releasemode="Stateful" />
    <jbo:DataSource id="DeptData" rangesize="6" appid="Bssbc4jModule" viewobject="DeptView1" />
    <jbo:DataSource id="EmpData" rangesize="6" appid="Bssbc4jModule" viewobject="EmpView1" />
    <jbo:DataSource id="JobData" rangesize="6" appid="Bssbc4jModule" viewobject="JobsView1" />
    <form action="/EmpEdit.jsp" name="emp_form" method="post">
    <table cellspacing="2" cellpadding="1" border="0" width="50%">
    <tr>
    <td>Employee ID</td>
    <td><jbo:InputRender datasource="EmpData" dataitem="Empno" formname="emp_form" ></jbo:InputRender>
    </td>
    </tr>
    <tr>
    <td>Employee Name</td>
    <td><jbo:InputRender datasource="EmpData" dataitem="Ename" formname="emp_form" ></jbo:InputRender>
    </td>
    </tr>
    <tr>
    <td>Job Description</td>
    <td><jbo:InputSelect multiple="false" datasource="EmpData" dataitem="Job" displaydatasource="JobData" displaydataitem="Jobtitle" displayvaluedataitem="Jobid" ></jbo:InputSelect>
    </td>
    </tr>
    <tr>
    <td>Hire Date</td>
    <td><jbo:InputDate datasource="EmpData" dataitem="Hiredate" formname="emp_form" readonly="true" ></jbo:InputDate>
    </td>
    </tr>
    <tr>
    <td>Salary</td>
    <td><jbo:InputText datasource="EmpData" dataitem="Sal" maxlength="5" readonly="false" ></jbo:InputText>
    </td>
    </tr>
    <tr>
    <td>Department</td>
    <td><jbo:InputSelectLOV datasource="EmpData" dataitem="Deptno" displaydatasource="DeptData" displaydataitem="Dname" displayvaluedataitem="Deptno" formname="emp_form" ></jbo:InputSelectLOV>
    </td>
    </tr>
    </table>
    </form>
    // i use this but its not working
    <uix:submitButton id="Update" formName="emp_form" destination="EmpBrowse.jsp" name="Update" text="Update" />
    <uix:resetButton id="ReSet" formName="emp_form" name="ReSet" />
    <jbo:ReleasePageResources />
    </body>

    See this thread for customizing the layout of a DataEdit component:
    Working with DataEdit Tag
    The DataEdit is intended to render all fields in the datasource on the screen. If you only want one field you can simply open a form tag, add an input field, add submit buttons (html submit buttons) and close the form tag. If you add a DataHandler to the page it will even do the DML for you.

  • Zen X-fi cannot be turned on and reset button is useless

    Hi, I, ve been using my new zen x-fi 8gb for almost a month, i've tried transffered any media files and the player was working ok. however, today my player does not want to start at all and i tried pressing the reset button but nothing happen. i also tried to connect it to my PC (XP SP2), and all i heard was the blip sound from my PC, but my PC does not detect my mp3 player nor my player turned on. I've tried to connect it to the back usb port, plug it to ps2 and wii usb port, but still does not work.
    additional information:
    . i fully recharged the player last night
    2. i tried half connect my headphone to the playe, and i still hear a hissing noise from the player when i tried to turn the power on, but still nothing appear
    3. i just tried the tips that required to press and hold play button, press the reset and slide the power button, but didn't work
    thanks for the help, i really need every suggestion
    Message Edited by dewa_botak on 06-2-2009 09:2 PMMessage Edited by dewa_botak on 06-2-2009 09:3 PM

    Your screen may be broken? Its still inder a one year warranty.

  • Submit and Reset button not working

    Hi, am new in the forum, php, dreamweaver and flash.
    i have been working on a website for my client using flash, and i had to create a form
    on my contact page that user can use to submit their queries.
    i managed to download a step by step code using php. It guided me through everything
    but my problem is once i uploaded the website on the server the button submit and reset it not doing it job.
    here is the website. www.kulaevent.com
    it takes couple second for the contact form to appear.
    Please help, please

    Thank you
    I have checked the link you gave and i managed to update my form and i uploaded
    on the site and it worked.
    Thanks again

  • MSI P67A-GD65 (B3) Power and Reset button wont work.

    Right..i just bought this mobo.. Build the PC..Everything works fine...since i can open the pc from the button on the mobo..thing is:
    The leds and HDD light work perfectly fine..
    Power On/Off wont work
    Reset wont work.
    The cables are connected properly
    Power SW:Orange (Positive) at 6.. Negative at 8...
    Reset SW:Blue (Positive) at 7.. Negative at 5.
    Power LED and HDD Led work fine..
    They just wont work.. Should i RMA the card or is it something else i am missing?
    Obviously i checked the buttons themselves..removed the front panel..nothing seems weird..
    The buttons worked perfectly fine ~1 hour before i went to get the new stuff ;p

    Does the reset button work?  Have you tried using a screwdriver to short the pins?  It may be the case and not the MOBO.  Also, try reversing the connectors.
    First image is of the reset switch on the MOBO.
    The second image is of the pin layout.

Maybe you are looking for