Results 1 to 8 of 8
  1. #1
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Question Reset form button and duplicated data

    I am hoping that someone can help

    I have a gui, has a reset button on it, at the moment it contains duplicate data as when the app first runs.

    Is there a way to set it so that the reset button triggers the program to go straight to the top of the file so that the data is only in the program once rather than in the array and in the reset button?

    Thanks in advance

  2. #2
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Default

    I currently have this working with duplicate data in 2 areas, I realise that this is not good practice but at the moment is the only way I know although I do realise there has to be a way to resolve this.

    Thanks in advance for suggestions

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  4. #4
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Question

    No what i mean is i have a list of 40 strings in total in an array, I aalso have a reset button on the gui, in this gui I have duplicated those strings so there is duplicate data.

    What I am trying to do is get the reset button to read the original data rather than adding 40 lines to the program.

    Is there a way round it

    Thanks in advance

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Sorry, but I really have no idea of what you're talking about. You must post your question as if we don't know your program inside and out as you do. We can't read your mind.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    I would assume that you're trying to change the information displayed in your GUI to a previous state -- and there are many many ways to do this, the best will likely depend on the set up of your current program and the details on what you are trying to achieve. Are you trying to restart some initial conditions? Perhaps you want to use a a data file or a program Properties that are re-read on reset. Are you trying to "un-do" an action? Then perhaps you want to save state in a Stack. But I have no idea what would work best for you given the information thus posted.

  7. #7
    dbashby's Avatar
    dbashby is offline Senior Member
    Join Date
    Mar 2009
    Posts
    223
    Rep Power
    6

    Question

    ok, here is the gui in netbeans



    The data that is displayed in the textfields is in 2 places, i have it under

    Java Code:
    public class BubbleSort extends javax.swing.JFrame {
    and then exaclty the same data as displayed under

    Java Code:
    private void cmdResetActionPerformed(java.awt.event.ActionEvent evt) {
    What I want to know is if after the user has done a sort or search if they press reset is there a way that I can get it to display the data you see without having duplicate data entered into the application?

    Thanks in advance

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 10
    Last Post: 08-12-2009, 05:02 PM
  2. enctype=multipart/form-data with form data in struts
    By vk_satheesh in forum New To Java
    Replies: 0
    Last Post: 09-19-2008, 01:48 PM
  3. <html:reset> button in struts
    By Satheeshhere in forum Web Frameworks
    Replies: 1
    Last Post: 07-15-2008, 04:14 PM
  4. simulate form type=button press with java application
    By redmoonzer01 in forum Networking
    Replies: 1
    Last Post: 03-29-2008, 07:28 AM
  5. Adding EXIT button on MIDlet form
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-22-2007, 11:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •