⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 incomecountdialogtreeaction.java

📁 一个优秀的干洗店管理系统
💻 JAVA
字号:
package view.control.viewaction;

import javax.swing.JPanel;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;

import view.dialog.countmanage.InComeCountDialog;

public class InComeCountDialogTreeAction implements TreeSelectionListener{
	
	private InComeCountDialog dialog;
	
	public InComeCountDialogTreeAction(InComeCountDialog dialog){
		this.dialog = dialog;
	}

	public void valueChanged(TreeSelectionEvent e) {
		// 获得选中的节点
		DefaultMutableTreeNode node = (DefaultMutableTreeNode) dialog.getJTree()
				.getLastSelectedPathComponent();
		// 获得选中的节点的字符串内容
		String nodeStr = node.getUserObject().toString();
		if (node.isLeaf()) {
			JPanel panel = dialog.infoPanel;
			if (nodeStr.equals("收入记录")) {
				dialog.cl.show(panel, "1");
				
			} else if (nodeStr.equals("按日分析收入")) {
				dialog.cl.show(panel, "2");
			} else if (nodeStr.equals("按月分析收入")) {
				dialog.cl.show(panel, "3");
			} else if (nodeStr.equals("按年分析收入")) {
				dialog.cl.show(panel, "4");
			} else if (nodeStr.equals("按洗衣类型分析收入")) {
				dialog.cl.show(panel, "5");
			} else{
				dialog.cl.show(panel, "5");
			}

		}
		
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -