Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ambrhino (Smalltalk/Amber-, Java-, Javascript-Mixture) example: makes HTTP-GET-Request & display result on a JFrame
| url con is isr br line content pane frame |
url := <new URL('')>.
con := url openConnection.
is := con getInputStream.
isr := <new InputStreamReader(is)>.
br := <new BufferedReader(isr)>.
content := ''.
line := ''.
[ line isNil ] whileFalse: [
line := br readLine.
content := content, line.
pane := <new JTextPane()>.
pane setContentType: 'text/html'.
pane setText: (content printString).
frame := <new JFrame()>.
frame getContentPane add: pane.
frame pack; setVisible: true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment