Display a GUI window. The window need not have any contents, but should respond to requests to be closed.

/* NetRexx */
options replace format comments java crossref symbols binary
 
import javax.swing.JFrame
import javax.swing.JLabel
import java.awt.BorderLayout
import java.awt.Font
import java.awt.Color
 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parse arg showText .
select
  when showText.length = 0          then addText = isTrue
  when 'YES'.abbrev(showText.upper) then addText = isTrue
  when showText = '.'               then addText = isTrue
  otherwise                              addText = isFalse
  end
title = 'Rosetta Code - Window Creation'
createFrame(title, addText)
 
return
 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
method createFrame(title, addText = boolean 0) public static
  do
    fenester = JFrame(title)
    fenester.setSize(600, 200)
    fenester.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
    if addText then decorate(fenester)
    fenester.setVisible(isTrue)
 
  catch ex = Exception
    ex.printStackTrace()
  end
 
  return
 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
method decorate(fenester = JFrame, textStr = 'This page intentionally left blank.') private static returns JFrame
  textlbl  = JLabel(textStr)
  textfont = Font(Font.SERIF, Font.BOLD, 20)
  textlbl.setHorizontalAlignment(JLabel.CENTER)
  textlbl.setFont(textfont)
  textlbl.setForeground(Color.ORANGE)
  fenester.add(textlbl, BorderLayout.CENTER)
 
  return fenester
 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
method isTrue() public static returns boolean
  return (1 == 1)
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
method isFalse() public static returns boolean
  return \(1 == 1)
 