Package com.kokakiwi.mclauncher.ui.simple.components

Examples of com.kokakiwi.mclauncher.ui.simple.components.TransparentLabel


        loginBox.setLayout(new BorderLayout(0, 8));
       
        final TransparentPanel titles = new TransparentPanel();
        titles.setLayout(new GridLayout(0, 1, 0, 2));
       
        titles.add(new TransparentLabel(Translater
                .getString("login.usernameLabel") + " :", 4));
        titles.add(new TransparentLabel(Translater
                .getString("login.passwordLabel") + " :", 4));
        titles.add(new TransparentLabel("", 4));
       
        titles.setInsets(0, 0, 0, 4);
       
        final TransparentPanel fields = new TransparentPanel();
        fields.setLayout(new GridLayout(0, 1, 0, 2));
View Full Code Here


        labelPanel.add(new JLabel(Translater.getString("options.offlineMode")
                + " :"));
        fieldPanel.add(offlineModeToggle);
       
        // GAME LOCATION
        final TransparentLabel dirLink = new TransparentLabel(api
                .getMinecraftDirectory().toString()) {
            private static final long serialVersionUID = 0L;
           
            public void paint(Graphics g)
            {
                super.paint(g);
               
                int x = 0;
                int y = 0;
               
                final FontMetrics fm = g.getFontMetrics();
                final int width = fm.stringWidth(getText());
                final int height = fm.getHeight();
               
                if (getAlignmentX() == 2.0F)
                {
                    x = 0;
                }
                else if (getAlignmentX() == 0.0F)
                {
                    x = getBounds().width / 2 - width / 2;
                }
                else if (getAlignmentX() == 4.0F)
                {
                    x = getBounds().width - width;
                }
                y = getBounds().height / 2 + height / 2 - 1;
               
                g.drawLine(x + 2, y, x + width - 2, y);
            }
           
            public void update(Graphics g)
            {
                paint(g);
            }
        };
        dirLink.setCursor(Cursor.getPredefinedCursor(12));
        dirLink.addMouseListener(new MouseAdapter() {
           
            public void mousePressed(MouseEvent arg0)
            {
                try
                {
                    if (Desktop.isDesktopSupported())
                    {
                        Desktop.getDesktop().open(api.getMinecraftDirectory());
                    }
                }
                catch (final Exception e)
                {
                    e.printStackTrace();
                }
            }
        });
        dirLink.setForeground(new Color(2105599));
       
        labelPanel.add(new JLabel(Translater
                .getString("options.gameLocationLabel") + " : "));
        fieldPanel.add(dirLink);
       
View Full Code Here

TOP

Related Classes of com.kokakiwi.mclauncher.ui.simple.components.TransparentLabel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.