0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jsonを取得、表示するアプリケーション その1

Last updated at Posted at 2013-09-12

とりあえずテキストフィールド、ボタン、テキストエリアだけのシンプルな画面をSwingBuilderで作る。

json_client.groovy
import groovy.swing.SwingBuilder
import javax.swing.*
import java.awt.*

def txtUrl
def txtJson

new SwingBuilder().frame(title:'', defaultCloseOperation:JFrame.EXIT_ON_CLOSE, size: [800, 600], show:true) {
	borderLayout()
	hbox(constraints: BorderLayout.NORTH) {
		txtUrl = textField()
		button(text:'送信', actionPerformed:{txtJson.text = txtUrl.text})
	}
	scrollPane(constraints: BorderLayout.CENTER) {
		txtJson = textArea(editable:false)
	}
}

qiita-001.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?