Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Message box won't show up

 
Aer crp
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to teach myself Java and have just started to use message boxes to get input.
However the message boxes won't show upp unless i place them first in the code:

I dont know why it wont work unless i place the box first
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what you mean by "place the box first". How about if you post your original code and describe your problem in a little more detail?
 
Aer crp
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Sorry for the slow reply. What i mean is that if i write


the message box will be displayed but if

is not the first thing that is executed then the program runs fine up until it encounters the message box function (statement? Sorry dont really know the linquo yet ).
It doesn't matter where i place the code for the message box, it won't work unless it is first in the code.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aer crp wrote:is not the first thing that is executed then the program runs fine up until it encounters the message box function

So, what happens if you place it somewhere else? Do you get an error message? Where would you for example want to place the code, if you're not placing it as the first thing?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic