Results 1 to 3 of 3
  1. #1
    dinosoep is offline Senior Member
    Join Date
    Nov 2009
    Posts
    150
    Rep Power
    6

    Default passing something

    I have a class which creates the ui.
    it also creates a thread.
    When the user presses a button I want to change a boolean from the other thread, how do I do that?

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

    Default

    I'm confused as a boolean doesn't really exist within a thread though can be changed from one thread or another. Is the boolean volatile? Perhaps you would be best served to create a small compilable example of your problem, an SSCCE.
    Last edited by Fubarable; 12-05-2009 at 06:36 AM.

  3. #3
    dinosoep is offline Senior Member
    Join Date
    Nov 2009
    Posts
    150
    Rep Power
    6

    Default

    I know practicly nothing of threading but I got a class which extends runnable
    that class has a boolean
    I create a thread of that class but when I press a button I want a boolean in That class set to false

Similar Threads

  1. Passing a value..
    By Lagarto in forum New To Java
    Replies: 3
    Last Post: 01-23-2011, 06:58 PM
  2. MVC passing objects
    By simo_mon in forum New To Java
    Replies: 1
    Last Post: 07-17-2009, 07:57 AM
  3. Passing Strings ?
    By aldo1987 in forum New To Java
    Replies: 17
    Last Post: 04-24-2009, 06:03 AM
  4. passing a parameter
    By aarthi2learn in forum AWT / Swing
    Replies: 4
    Last Post: 12-22-2008, 06:46 AM
  5. passing value from jsp to applet
    By bhupendrabjain in forum Java Applets
    Replies: 4
    Last Post: 10-07-2008, 02:55 PM

Posting Permissions

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