引入org.xmind.core Jar文件
在XMind的安装目录plugins目录搜索org.xmind.core,找到org.xmind.core.****.jar文件引入到你的项目中(只需要一个jar,其中****表示版本号)
IWorkbookBuilder builder = Core.getWorkbookBuilder();// 初始化builder
IWorkbook workbook = null;
try {
workbook = builder.loadFromFile(new File("C:/Users/lch/Desktop/qj.xmind"));// 打开XMind文件
} catch (Exception e) {
}
ISheet defSheet = workbook.getPrimarySheet();// 获取主Sheet
ITopic rootTopic = defSheet.getRootTopic(); // 获取根Topic
String className = rootTopic.getTitleText();//节点TitleText
List<ITopic> allChildren = allChildren.getAllChildren();//获取所有子节点
jar包下载
链接:https://pan.baidu.com/s/1yWDKXAMyeafkJ6WQkLz7aQ
提取码:w7rf