{"id":524,"date":"2004-03-20T21:00:00","date_gmt":"2004-03-20T12:00:00","guid":{"rendered":"\/?p=524"},"modified":"2004-03-20T21:00:00","modified_gmt":"2004-03-20T12:00:00","slug":"internal-dialogbox","status":"publish","type":"post","link":"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/524.html","title":{"rendered":"Internal Dialogbox"},"content":{"rendered":"<p>\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u4e2d\u306b\u7d0d\u307e\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001JOptionPane.showInternalxxxxxDialog\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3002MessageDialog, InputDialog \u306e\u4f7f\u7528\u4f8b\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002 <br \/>\n<!--more--><\/p>\n<div class=\"code\">package org.sssg.four.java;<\/p>\n<p>import javax.swing.AbstractAction;<br \/>\nimport javax.swing.Action;<br \/>\nimport javax.swing.ImageIcon;<br \/>\nimport javax.swing.JFrame;<br \/>\nimport javax.swing.JMenu;<br \/>\nimport javax.swing.JMenuBar;<br \/>\nimport javax.swing.JOptionPane;<\/p>\n<p>public class InternalAbout extends JFrame {<br \/>\n\tpublic InternalAbout() {<br \/>\n\t\tJMenuBar menuBar = new JMenuBar();<br \/>\n\t\tJMenu menu = new JMenu(&#8220;Help&#8221;);<br \/>\n\t\tAction aboutAction = new AboutAction();<br \/>\n\t\tAction inputAction = new InputAction();<br \/>\n\t\tmenu.add(inputAction);<br \/>\n\t\tmenu.add(aboutAction);<br \/>\n\t\tmenuBar.add(menu);<\/p>\n<p>\t\tsetJMenuBar(menuBar);<br \/>\n\t\tsetSize(400, 250);<br \/>\n\t}<br \/>\n\tclass AboutAction extends AbstractAction {<br \/>\n\t\tpublic AboutAction() {<br \/>\n\t\t\tsuper(&#8220;About&#8221;);<br \/>\n\t\t}<br \/>\n\t\tpublic void actionPerformed(java.awt.event.ActionEvent ev) {<br \/>\n\t\t\tImageIcon icon = new ImageIcon(&#8220;about.png&#8221;);<br \/>\n\t\t\tJOptionPane.showInternalMessageDialog(<br \/>\n\t\t\t\tgetContentPane(),<br \/>\n\t\t\t\t&#8220;About RemoconComponentTest&#8221;,<br \/>\n\t\t\t\t&#8220;Title.&#8221;,<br \/>\n\t\t\t\tJOptionPane.PLAIN_MESSAGE,<br \/>\n\t\t\t\ticon);<br \/>\n\t\t}<br \/>\n\t}<br \/>\n\tclass InputAction extends AbstractAction {<br \/>\n\t\tpublic InputAction() {<br \/>\n\t\t\tsuper(&#8220;Host&#8221;);<br \/>\n\t\t}<br \/>\n\t\tpublic void actionPerformed(java.awt.event.ActionEvent ev) {<br \/>\n\t\t\tString host = JOptionPane.showInternalInputDialog(<br \/>\n\t\t\t\tgetContentPane(),<br \/>\n\t\t\t\t&#8220;Host:&#8221;,<br \/>\n\t\t\t\t&#8220;Please input data&#8221;,<br \/>\n\t\t\t\tJOptionPane.PLAIN_MESSAGE);<br \/>\n\t\t\tSystem.out.println(host);<br \/>\n\t\t}<br \/>\n\t}<br \/>\n\tpublic static void main(String[] args) {<br \/>\n\t\tInternalAbout f = new InternalAbout();<br \/>\n\t\tf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br \/>\n\t\tf.setVisible(true);<br \/>\n\t}<br \/>\n}<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u4e2d\u306b\u7d0d\u307e\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001JOptionPane.showInternalxxxxxDialog\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3002MessageDialog, InputDialog \u306e\u4f7f\u7528\u4f8b\u3092\u4f5c\u3063\u3066\u307f &hellip; <a href=\"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/524.html\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-524","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/comments?post=524"}],"version-history":[{"count":0,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/524\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/media?parent=524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/categories?post=524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/tags?post=524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}