Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以建议我使用JScrollPane, JTextArea 等在 Java Swing 中创建“最近打开”即历史类型功能的基本步骤。
JScrollPane,
任何不同的框架,如,frame1等,我们打开它的名称都会在这个作为主屏幕一部分的文本区域中动态列出(一个主 jframe)。如果我们单击“最近打开”文本区域中生成的列表中的任何一个,相应的框架将再次显示。frame2frame3
frame1
frame2
frame3
请回复,我的项目中需要它。请看这里的图:
谢谢。
如果历史记录是针对单个对象的,例如选项卡式窗格 (http://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html),您可以创建该类的子类并重载选择方法,创建历史元素。
这个问题有点模糊,所以很难说得更具体。但是您可能应该考虑在您将使用的任何类中重载方法。