External Exam Download Resources Web Applications Games Recycle Bin

hello World



setup Form
Window --> IDE Tools --> Palette
  1. drag and drop 1 Button and 1 Label onto JFrame Form from Palette
  2. Window --> IDE Tools --> Properties
  3. with button selected find jButton1 Properties, click on Code and change Variable Name to btnClick
  4. do same with label but name it lblHello
  5. make Button, Label and jFrame Form look pretty by playing with Properties

adding Event
  1. double-click button (you will end up in Source view)
  2. flip back to Design view
  3. select btnClick and find its Events
  4. Window --> IDE Tools --> Properties
  5. click on the ellipsis next to actionPerformed. You can rename events here if you like (don't have to).

add Code
  1. go back to Source view and find btnClickActionPerformed procedure (or whatever you renamed Event to)
  2. position your cursor next to the comment that says // TODO add your handling code here: and hit enter to start typing on the next line below
  3. add code:
  4. lblHello.setText("Hello World");
  5. play