如何在Java Swing中创建可折叠和可扩展面板? [英] how to create collapsible and expandable panel in Java Swing?

查看:661
本文介绍了如何在Java Swing中创建可折叠和可扩展面板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Java Swing中创建一个可折叠和扩展的面板..我无法在Netbeans 7.4的DESIGN PALETTE中找到它..请帮助我

I need to create a collapsible and expandable panel in Java Swing.. I am not able to find it in the DESIGN PALETTE of Netbeans 7.4 .. Kindly help me

推荐答案

JavaFX具有一个JFXPanel类,该类允许您将JavaFX组件嵌入到Swing中.使用它,您可以将TitledPaneAccordion控件嵌入到您的Swing应用程序中.

JavaFX has a JFXPanel class which allows you to embed JavaFX components in Swing. Using that, you can embed the TitledPane and Accordion controls into your Swing application.

您的最终结果将是这样:

Your end result will be like this:

这正是您所需要的,不是吗? =)
这样可以节省大量的编码工作.

This is exactly what you need, isn't it ? =)
This saves you a lot of coding work.

有关如何使用这些JavaFX组件的教程,请参见: http ://docs.oracle.com/javafx/2/ui_controls/accordion-titledpane.htm
在此处将JavaFX节点嵌入到此处:如何将JFXPanel添加到现有的swing应用

Tutorial on how to work with these JavaFX components is here: http://docs.oracle.com/javafx/2/ui_controls/accordion-titledpane.htm and
embedding of JavaFX nodes in Swing is here: How to add JFXPanel to already existing swing app

这篇关于如何在Java Swing中创建可折叠和可扩展面板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆