{"id":975,"date":"2018-04-17T18:59:08","date_gmt":"2018-04-17T09:59:08","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=975"},"modified":"2018-12-23T01:59:03","modified_gmt":"2018-12-22T16:59:03","slug":"get-system-icon","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/ko\/blog\/java\/get-system-icon","title":{"rendered":"Java \uc2dc\uc2a4\ud15c \uc544\uc774\ucf58 \ucd94\ucd9c"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\">Java <strong>\uc2dc\uc2a4\ud15c \uc544\uc774\ucf58<\/strong>\ucd94\ucd9c<\/a><\/h2>\n<p>\n<strong>Java<\/strong>\uc5d0\uc11c \uc9c0\uc815\ub41c \ud30c\uc77c\uc758 \uc544\uc774\ucf58\uc744 png \ud615\uc2dd\uc758 \uc774\ubbf8\uc9c0 \ud30c\uc77c\ub85c \ucd94\ucd9c\ud558\ub294 \uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8\uc744 \uc18c\uac1c\ud569\ub2c8\ub2e4. \uc9c0\uc815\ud558\ub294 \ud30c\uc77c\uc740 \ud655\uc7a5\uc790 exe \ub4f1\uc758 \uc2e4\ud589 \ud30c\uc77c\uc774\ub098, dll, xls, doc \ub4f1 \ubb34\uc5c7\uc774\ub4e0 \ucd94\ucd9c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ube44\uc2b7\ud55c \ubc29\ubc95\uc744 \uc778\ud130\ub137\uc5d0\uc11c \uc5ec\ub7ec\uac00\uc9c0 \uc870\uc0ac\ud588\ub294\ub370, \ub208\uc5d0 \ub744\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4.<br \/>\n\ud558\uc9c0\ub9cc \uc2e4\ub85c \uac04\ub2e8\ud558\uac8c \ucde8\ub4dd\ud560 \uc218 \uc788\ub294 \ubc29\ubc95\uc744 \ubc1c\uacac\ud588\uc73c\ubbc0\ub85c \uc18c\uac1c\ud569\ub2c8\ub2e4.<br \/>\n\ub610\ud55c, Chat &amp; Messenger\uc5d0\uc11c\ub294\uc774 \ubc29\ubc95\uc744,<a href=\"https:\/\/chat-messenger.com\/ko\/manual\/messenger_chat\/sticky_note\/\"><strong>\uc2a4\ud2f0\ucee4 \uba54\ubaa8\uc5d0 \ud30c\uc77c\uc744 \ucca8\ubd80\ud558\ub294 \uae30\ub2a5<\/strong><\/a>\uc5d0\uc11c \uc774\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2 class=\"common_title\"><a name=\"1\">\uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8 \ub3d9\uc791 \ud655\uc778<\/a><\/h2>\n<p><a href=\"http:\/\/hp.vector.co.jp\/authors\/VA045104\/swing_ex\/IconExtractor.jar\"><strong>\uc0d8\ud50c \uc2e4\ud589<\/strong><\/a><br \/>\n<br \/><span style=\"font-size:x-small;\">\u203b jar \ud30c\uc77c\uc774 \uad00\ub828\ub418\uc5b4 \uc788\ub294 \uacbd\uc6b0, \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<ol>\n<li>\uc0d8\ud50c \uc18c\uc2a4\ub97c \uc5bb\uace0 \ucef4\ud30c\uc77c\ud558\uace0 \uc2e4\ud589\ud558\uc2ed\uc2dc\uc624.\n<\/li>\n<li>\uae30\ub3d9\ud558\uba74 \uba54\uc778 \uc708\ub3c4\uc6b0\uac00 \uc5f4\ub9ac\ubbc0\ub85c, \ucd94\ucd9c\ud558\uace0 \uc2f6\uc740 \uc544\uc774\ucf58\uc744 \uadf8\ub300\ub85c \uc708\ub3c4\uc6b0\uc5d0 \ub4dc\ub798\uadf8\uff06\ub4dc\ub86d \ud574 \uc8fc\uc138\uc694.<br \/>\n<img src=\"https:\/\/chat-messenger.com\/images\/IconExtractor.jpg\" alt=\"\uc544\uc774\ucf58 \ud68d\ub4dd\" border=\"0\"><\/p>\n<\/li>\n<li>\uc6d0\ub798 \uc544\uc778\ucf58\uacfc \uac19\uc740 \uc704\uce58\uc5d0 png \ud615\uc2dd\uc758 \uc774\ubbf8\uc9c0 \ud30c\uc77c\uc774 \ucd9c\ub825\ub429\ub2c8\ub2e4.<br \/>\n<img src=\"https:\/\/chat-messenger.com\/images\/IconExtractor2.jpg\" alt=\"\uc544\uc774\ucf58 \ud68d\ub4dd\" border=\"0\"><\/p>\n<\/li>\n<\/ol>\n<p><script type=\"text\/javascript\" src=\"https:\/\/chat-messenger.com\/js\/common.js?dd12sssas2223\" charset=\"UTF-8\"><\/script><br \/>\n<script type=\"text\/javascript\"> writePR(); <\/script><\/p>\n<h2 class=\"common_title\"><a name=\"2\">\uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8 \uc124\uba85<\/a><\/h2>\n<p>Java\ub85c \uc544\uc774\ucf58\uc744 \ucd94\ucd9c\ud558\ub294 \ucc98\ub9ac\ub294, \uc774\ud558\uc758 \ubc29\ubc95\uc73c\ub85c \uc2e4\ud604\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<ol>\n<li>\nLook &amp; Feel\uc744 Windows\ub85c \uc124\uc815\ud569\ub2c8\ub2e4.<br \/>\nUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());<\/p>\n<\/li>\n<li>\n\ub4dc\ub798\uadf8 \uc564 \ub4dc\ub86d\uc73c\ub85c \uc5bb\uc740 \ud30c\uc77c <strong>javax.swing.JFileChooser.getIcon()<\/strong> \ubc29\ubc95\uc73c\ub85c <strong>javax.swing.Icon<\/strong> \uac1d\uccb4\ub85c \ubcc0\ud658\ud569\ub2c8\ub2e4.<\/p>\n<\/li>\n<li>\n<strong>javax.imageio.ImageIO.write()<\/strong> \uba54\uc11c\ub4dc\ub294 Icon \uac1d\uccb4\ub97c png \ud615\uc2dd\uc758 \uc774\ubbf8\uc9c0 \ud30c\uc77c\ub85c \ucd9c\ub825\ud569\ub2c8\ub2e4.<\/p>\n<\/li>\n<\/ol>\n<h2 class=\"common_title\"><a name=\"3\">\uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8<\/a><\/h2>\n<p><textarea readonly=\"readonly\" style=\"font-size: 13px;height: 400px;\" class=\"src\" onclick=\"this.focus();this.select()\">import java.awt.BorderLayout;<br \/>\nimport java.awt.Color;<br \/>\nimport java.awt.datatransfer.DataFlavor;<br \/>\nimport java.awt.datatransfer.Transferable;<br \/>\nimport java.awt.dnd.DnDConstants;<br \/>\nimport java.awt.dnd.DropTarget;<br \/>\nimport java.awt.dnd.DropTargetDragEvent;<br \/>\nimport java.awt.dnd.DropTargetDropEvent;<br \/>\nimport java.awt.dnd.DropTargetEvent;<br \/>\nimport java.awt.dnd.DropTargetListener;<br \/>\nimport java.awt.image.BufferedImage;<br \/>\nimport java.io.File;<br \/>\nimport java.util.Iterator;<br \/>\nimport java.util.List;<\/p>\n<p>import javax.imageio.ImageIO;<br \/>\nimport javax.swing.ImageIcon;<br \/>\nimport javax.swing.JFileChooser;<br \/>\nimport javax.swing.JFrame;<br \/>\nimport javax.swing.JLabel;<br \/>\nimport javax.swing.JPanel;<br \/>\nimport javax.swing.SwingConstants;<br \/>\nimport javax.swing.UIManager;<\/p>\n<p>public class IconExtractor extends JFrame<br \/>\n                implements DropTargetListener {<\/p>\n<p>    private JPanel jContentPane = null;<br \/>\n    private JLabel jLabel = null;<br \/>\n    private JFileChooser chooser;<\/p>\n<p>    public static void main(String[] args) {<br \/>\n        IconExtractor extractor = new IconExtractor();<br \/>\n        extractor.setVisible(true);<br \/>\n    }<\/p>\n<p>    public IconExtractor() {<br \/>\n        super();<br \/>\n        try {<br \/>\n            UIManager.setLookAndFeel (<br \/>\n                    UIManager.getSystemLookAndFeelClassName());<br \/>\n            chooser = new JFileChooser();<br \/>\n        } catch (Exception e) {<br \/>\n            e.printStackTrace();<br \/>\n        }<br \/>\n        initialize();<br \/>\n    }<\/p>\n<p>    private void initialize() {<br \/>\n        this.setSize(300, 200);<br \/>\n        this.setContentPane(getJContentPane());<br \/>\n        this.setTitle(&quot;\uc544\uc774\ucf58 \ucd94\ucd9c&quot;);<br \/>\n        this.setLocationRelativeTo (null);<br \/>\n        this.setDefaultCloseOperation (EXIT_ON_CLOSE);<br \/>\n    }<\/p>\n<p>    private JPanel getJContentPane() {<br \/>\n        if (jContentPane == null) {<br \/>\n            jLabel = new JLabel();<br \/>\n            jLabel.setText(\u201c\uc544\uc774\ucf58\uc744 \ub4dc\ub798\uadf8\ud558\uc2ed\uc2dc\uc624.\u201d);<br \/>\n            jLabel.setBackground (Color.white);<br \/>\n            jLabel.setHorizontalAlignment(SwingConstants.CENTER);<br \/>\n            jLabel.setOpaque(true);<br \/>\n            \uc0c8\ub85c\uc6b4 DropTarget (jLabel,<br \/>\n                    DnDConstants.ACTION_COPY_OR_MOVE, this);<br \/>\n            jContentPane = new JPanel();<br \/>\n            jContentPane.setLayout(new BorderLayout());<br \/>\n            jContentPane.add(jLabel, BorderLayout.CENTER);<br \/>\n        }<br \/>\n        return jContentPane;<br \/>\n    }<\/p>\n<p>    \/\/ \u2014 implements DropTargetListener \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014-<br \/>\n    public void drop (DropTargetDropEvent dtde) {<br \/>\n        dtde.acceptDrop(DnDConstants.ACTION_MOVE);<br \/>\n        try {<\/p>\n<p>            Transferable tran = dtde.getTransferable();<\/p>\n<p>            List fileList = (List) tran<br \/>\n                    .getTransferData(DataFlavor.javaFileListFlavor);<br \/>\n            Iterator iterator = fileList.iterator();<br \/>\n            while (iterator.hasNext()) {<br \/>\n                File file = (File) iterator.next();<br \/>\n                ImageIcon icon = (ImageIcon) chooser.getIcon(file);<br \/>\n                String ext = file.getAbsoluteFile() + \u201c.png\u201d;<br \/>\n                \/\/ \uc774\ubbf8\uc9c0 \ud30c\uc77c \uc800\uc7a5<br \/>\n                ImageIO.write((BufferedImage) icon.getImage(), \u201cpng\u201d,<br \/>\n                        \uc0c8\ub85c\uc6b4 \ud30c\uc77c (ext));<br \/>\n                jLabel.setText(&ldquo;&lt;html&gt;\ucd94\ucd9c \uc644\ub8cc&lt;br&gt;&rdquo; + ext);<br \/>\n                setIconImage(icon.getImage());<br \/>\n            }<br \/>\n            dtde.dropComplete(true);<br \/>\n        } catch (Exception e) {<br \/>\n            e.printStackTrace();<br \/>\n            dtde.dropComplete(false);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    public void dragEnter(DropTargetDragEvent e) {<br \/>\n    }<\/p>\n<p>    public void dragOver (DropTargetDragEvent e) {<br \/>\n    }<\/p>\n<p>    public void dropActionChanged (DropTargetDragEvent e) {<br \/>\n    }<\/p>\n<p>    public void dragExit (DropTargetEvent e) {<br \/>\n    }<br \/>\n}<br \/>\n<\/textarea><\/p>","protected":false},"excerpt":{"rendered":"<p>Java \uc2dc\uc2a4\ud15c \uc544\uc774\ucf58 \ucd94\ucd9c Java\uc5d0\uc11c \uc9c0\uc815\ub41c \ud30c\uc77c\uc758 \uc544\uc774\ucf58\uc744 png \ud615\uc2dd\uc758 \uc774\ubbf8\uc9c0 \ud30c\uc77c\ub85c \ucd94\ucd9c [\u2026]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/975"}],"collection":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/comments?post=975"}],"version-history":[{"count":5,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/975\/revisions"}],"predecessor-version":[{"id":1872,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/975\/revisions\/1872"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/media?parent=975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/categories?post=975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/tags?post=975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}