且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在不制作新图表的情况下将jzy3d图表添加到JFrame?

更新时间:2023-09-20 14:03:16

A CardLayout 非常适合这种用法.有关详细信息和工作示例,请参见如何使用CardLayout .

其他组合数据的策略可以在以下链接中看到/链接:..

Other strategies for combining data can be seen in/linked from this answer to "The Use of Multiple JFrames, Good/Bad Practice?".

充实这个想法.

  • 不要扩展框架,只需保留对面板的引用即可.
  • 使面板为GridLayoutBorderLayout(任何不受限制地添加到其中的单个组件,将被拉伸到可用的宽度和高度).
  • 按照上面的代码片段中的操作,对该面板进行足够的填充.
  • 将该面板添加到主框架(也是唯一框架)的CardLayout卡中.
  • (如有必要)翻转到该卡.
  • Don't extend frame, simply keep a reference to a panel.
  • Make the panel a GridLayout or BorderLayout (any single component added to either with no constraint, will be stretched to the available width & height).
  • Fill that panel much as you are doing in the code snippet above.
  • Add that panel to a card of a CardLayout in the main (and only) frame.
  • (If necessary) flip to that card.