package dao;

import java.awt.EventQueue;
import java.awt.Scrollbar;
import java.awt.Toolkit;
import java.sql.SQLException;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.ImageIcon;
import java.awt.Color;
import javax.swing.JScrollBar;

public class Kill extends LOL1  {

	private JScrollPane scr;
	private String textField;//英雄名字
	private JFrame frame;
	private String name;//技能键位
	/*public void setName(String name) {
		this.name=name;
	}*/
	//public void gettext(String textField) {
		//this.textField=textField;
	//}
	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Kill window = new Kill();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	public Kill() {
		initialize();
	}*/

	/**
	 * Create the application.
	 */
	public JFrame getFrame() {
		return frame;
	}
	public Kill(String name,String textField) {//构造函数
		this.name=name;//键位名称
		this.textField=textField;//英雄名城
	}

	/**
	 * Initialize the contents of the frame.
	 */
	public void initialize() {
		frame = new JFrame("技能详解");
		frame.setBounds(100, 100, 320, 365);
		frame.setIconImage(Toolkit.getDefaultToolkit().getImage(Kill.class.getResource("/LOLimage/game.png")));
		frame.setLocationRelativeTo(null);// 窗体居中
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		/*frame.setUndecorated(true);// 取消窗体修饰效果
		frame.getContentPane().setLayout(null);// 窗体使用绝对布局
		frame.setLocationRelativeTo(null);// 窗体居中
		frame.setAlwaysOnTop(true); //窗体最顶层显示*/
		frame.getContentPane().setLayout(null);
		
		JLabel lblNewLabel = new JLabel("");//技能图标
		lblNewLabel.setIcon(new ImageIcon(Kill.class.getResource("/LOLkill/"+this.textField+"-"+this.name+".png")));
		lblNewLabel.setBounds(126, 75, 64, 64);
		frame.getContentPane().add(lblNewLabel);
		
		
	
		JLabel lblNewLabel_1 = new JLabel("New label");//技能名称
		lblNewLabel_1.setBounds(23, 160, 78, 15);
		Sqljiname sqlji=new Sqljiname(this.textField,this.name);
		try {
			lblNewLabel_1.setText(sqlji.select()+":");//返回技能名称
		} catch (SQLException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
		frame.getContentPane().add(lblNewLabel_1);
		
		JLabel lblNewLabel_2 = new JLabel("New label");//logo
		lblNewLabel_2.setIcon(new ImageIcon(Kill.class.getResource("/LOLimage/logo.png")));
		lblNewLabel_2.setBounds(10, 10, 140, 64);
		frame.getContentPane().add(lblNewLabel_2);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(98, 156, 154, 150);
		frame.getContentPane().add(scrollPane);
		
		Sqljiall sqlall=new Sqljiall(this.textField,this.name);//实例化查询技能详情
		JTextArea textArea = new JTextArea();//技能介绍
		scrollPane.setViewportView(textArea);
		textArea.setBackground(new Color(245, 245, 245));
		textArea.setWrapStyleWord(true);
		textArea.setLineWrap(true);
		try {
			textArea.append(sqlall.select());
		} catch (SQLException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}
}
最近下载更多
buhuia  LV4 2023年6月9日
Hsy605  LV9 2022年6月22日
孙纪龙啊  LV10 2021年12月12日
不如不遇倾城色  LV1 2021年12月9日
wl2301821  LV7 2021年5月9日
最代码-宋家辉  LV61 2021年4月17日
ericxu1116  LV24 2021年4月7日
最代码官方  LV168 2021年3月7日
最近浏览更多
暂无贡献等级
夜起星河  LV8 2024年6月11日
bssheep  LV1 2023年12月31日
可乐123123  LV15 2023年12月20日
内心向阳  LV4 2023年11月7日
zhangjilu  LV18 2023年11月6日
jkjfdgbkl  LV2 2023年11月1日
阳光男孩阿葵 2023年7月14日
暂无贡献等级
y1214435276  LV9 2023年7月11日
泓鼎168  LV20 2023年6月13日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友