Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
54
Task/Window-creation/NetRexx/window-creation.netrexx
Normal file
54
Task/Window-creation/NetRexx/window-creation.netrexx
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/* 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue