package com.sencorsta.rabs.ui.help;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.GridLayout;
import java.nio.charset.Charset;

public class HelpWindow extends JFrame {
	private JLabel softwareNameLabel;
	private JLabel versionLabel;
	private JLabel jvmVersionLabel;
	private JLabel osVersionLabel;
	private JLabel charsetLabel;

	public HelpWindow() {
		init();
	}

	private void init() {
		setTitle("关于");
		setSize(300, 200);
		setLocationRelativeTo(null);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);

		JPanel panel = new JPanel();
		panel.setLayout(new GridLayout(5, 1));

		softwareNameLabel = new JLabel("软件名: Rabs");
		versionLabel = new JLabel("版本号: 0.1");
		jvmVersionLabel = new JLabel("JVM版本: " + System.getProperty("java.version"));
		osVersionLabel = new JLabel("操作系统版本: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
		charsetLabel = new JLabel("系统的默认编码: " +  Charset.defaultCharset());

		panel.add(softwareNameLabel);
		panel.add(versionLabel);
		panel.add(jvmVersionLabel);
		panel.add(osVersionLabel);
		panel.add(charsetLabel);

		getContentPane().add(panel);

	}
}
