XTaskPane 类似XP 左边的导航栏,在开发Swing应用的时候很好用的。
下面两张截图反应了JXTaskPane的动画效果。可以自由的卷起和展开。
JXTaskPane的的使用步骤:
1、新建一个 JXTaskPaneContainer
2、新建{i}个JXTaskPane (i>=1)
3、依次将 新建的JXTaskPane 添加到 JXTaskPaneContainer 中去。
4、最后将 JXTaskPaneContainer 添加到JFrame 中。
附上 SwingX doc中的示例代码
JXFrame frame = new JXFrame();
// a container to put all JXTaskPane together
JXTaskPaneContainer taskPaneContainer = new JXTaskPaneContainer();
// create a first taskPane with common actions
JXTaskPane actionPane = new JXTaskPane();
actionPane.setTitle("Files and Folders");
actionPane.setSpecial(true);
// actions can be added, a hyperlink will be created
Action renameSelectedFile = createRenameFileAction();
actionPane.add(renameSelectedFile);
actionPane.add(createDeleteFileAction());
// add this taskPane to the taskPaneContainer
taskPaneContainer.add(actionPane);
// create another taskPane, it will show details of the selected file
JXTaskPane details = new JXTaskPane();
details.setTitle("Details");
// add standard components to the details taskPane
JLabel searchLabel = new JLabel("Search:");
JTextField searchField = new JTextField("");
details.add(searchLabel);
details.add(searchField);
taskPaneContainer.add(details);
// put the action list on the left
frame.add(taskPaneContainer, BorderLayout.EAST);
// and a file browser in the middle
frame.add(fileBrowser, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
默认JXTaskPane 的动画功能是起用的,你也可以关闭 :
只要 myJXTaskPane.setAnimated(false); 就可以了。
分享到:
相关推荐
汽车车轮钢圈加工机_三维3D设计图纸.zip
问题汇总_C语言、数据结构.docx
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
该项目为基于Java语言的CP-RPC框架设计源码,总计包含202个文件,其中Java源文件71个,XML配置文件46个,Java类文件38个,属性文件7个,Kotlin模块定义4个,Idea项目文件3个,Protobuf定义文件2个,Git忽略规则文件1个。
数据手册-DAC0832-datasheet.zip
全自动仿手工饺子机_三维3D设计图纸.zip
本项目是一款基于HTML语言的婚礼电子请帖H5邀请函设计源码,包含355个文件,涵盖109个JavaScript文件、87个Markdown文件、62个JSON文件、17个JPG图片文件、10个PNG图片文件、5个TypeScript文件、4个CSS样式文件,以及若干配置和忽略文件。该设计适用于制作结婚请柬、婚礼电子请帖和婚礼H5邀请函,为用户提供了丰富的视觉和交互体验。
该项目是一款基于Java和HTML技术的dingdang_car二手车市场设计源码,包含336个文件,涵盖205个Java源文件、63个XML配置文件、41个YAML配置文件、22个Git忽略文件、3个FTL模板文件、2个HTML文件。该系统致力于打造一个全面的二手车交易平台。
毕设答辩 参考的ppt
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
全自动水箱装配机_三维3D设计图纸.zip
本项目是一款基于Django2期的订单管理平台设计源码,共包含144个文件,其中Python文件44个,HTML、CSS、JavaScript文件共计70个,以及少量其他类型文件。该平台采用Python、HTML、CSS和JavaScript等多语言开发,旨在提供高效便捷的订单管理解决方案。
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
数据手册-AT45DB161B-datasheet.zip
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
数据手册-AMS1117-datasheet.zip
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
自动点胶机_三维3D设计图纸.zip