FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Java instant end





Dark-Tech
i have a method that HAS to be public static void is there anyway to immediately end the method ?
qbawler311
I'm not sure what you're asking. If you explain yourself I'm sure you will get help.
Liu
Add some type of flag so that the excess instructions wont be executed.
mschnell
I'm also really confused with what you want the method to do. I think I would also use a boolean. You can then keep the boolean outside of the method itself.

if(boolean)
{
//code here
}
NGRU-Kamikazie
no no no your going about it all wrong. try something like this...

Code:
public GUI( )
   {
      
      
         setTitle( "Lights ON!" );
      setSize( 415, 365 );
      setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
      setLocationRelativeTo(null);
      setVisible(true);
      
   }

Im guessing that you are trying to have it exit out of the method and do what ever its suposed to do, you cold try a break statement, which will immediately end the method where ever it is. If you need to break out and retrun somehting, try a return statment

Code:
public GUI( )
   {
      
      
         setTitle( "Lights ON!" );
      setSize( 415, 365 );
      setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
      setLocationRelativeTo(null);
      setVisible(true);
break;
OR
return (char/int/souble/string here)

      
   }
mschnell
NGRU-Kamikazie wrote:
no no no your going about it all wrong. try something like this...


No, we aren't going about it all wrong... First, how do you assume it's a GUI, and second, a break has to be in a loop or a switch and therefor it makes no sense to use a break to try to end a whole method, unless your whole method is a loop or switch.
scorpix
H1 man's
please letter me site (or link) for download lost version Java mashine.

Thank
Dark-Tech
I'm srry i was on a deadline for that and i didn't get a reply fast enough its been a while now and i can't remember what that was even for but i know i fixed it some how thx any way.
Related topics
Provocateur predicts 'end of corporate computing'
Yahoo takes on iTunes with new music service
Java Game
Java
[ java scripts ] email service
HTML editing Software
Which is the best Mobile phone
[Java] Top-Down Menu bar tweak.
Randomness is an illusion. [philosophy/science]
8 Trades the Insiders Allegedly Made
Google Instant Mark the End of SEO?
Java 2D ArrayLists
Recursive functions in java
Trying to learn Java
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.