

Task

Display the string       Goodbye, World!       on a GUI object   (alert box, plain window, text area, etc.).



Related task

   Hello world/Text


native javax.swing.{SwingUtilities, JPanel, JLabel, JFrame}
native java.awt.Font
 
def createAndShowGUI( msg ) =
  f = JFrame()
  f.setTitle( msg )
  f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE )
  p = JPanel()
  l = JLabel( msg )
  l.setFont( Font.decode(Font.SERIF + ' 150') )
  p.add( l )
  f.add( p )
  f.pack()
  f.setResizable( false )
  f.setVisible( true )
 
SwingUtilities.invokeLater( createAndShowGUI.runnable('Goodbye, World!') )