Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.7 kB
2
Indexable
Never
package Finals.com.src;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;


public class BorderlandsInfo extends JFrame implements ActionListener {
    private JButton closeBtn;
    private ImageIcon image1;
    BorderlandsInfo()
    {   
        
        JFrame frame1 = new JFrame();
        JLabel label1 = new JLabel("Software Information");
        JPanel p1 = new JPanel();
        JPanel p2 = new JPanel();
        JPanel p3 = new JPanel();
        JLabel label2 = new JLabel(image1);
        JLabel picjLabel = new JLabel("PICTURE HERE TEST");
        closeBtn = new JButton("Close");
        image1 = new ImageIcon(getClass().getResource("Borderlands.jpg"));;

        closeBtn.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                if(JOptionPane.showConfirmDialog(null, "Close Info", "Close Info", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
                frame1.dispose();
            }
        });
        
        p1.setLayout(new GridLayout(11,2));
        p1.add(label1);
        p1.add(label2);
        p2.add(closeBtn);
        p3.add(picjLabel);
        frame1.add(p3, BorderLayout.EAST);
        frame1.add(p2, BorderLayout.SOUTH);
        frame1.add(p1);
        frame1.pack();
        frame1.setDefaultCloseOperation(EXIT_ON_CLOSE);
        frame1.setVisible(true);
        frame1.setTitle("GamesXSoftWare Information");
        add(picjLabel);
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        // TODO Auto-generated method stub
        
    }
}