I'm writing a simple edit text in Java. When the user opens it, a file will be opened in JTabbedPane
. I did the following to save the files opened:
HashMap<String, Tab> hash = new HashMap<String, Tab>();
Where Tab
will receive the values, such as: File file, JTextArea container, JTabbedPane tab
.
I have a class called Tab
:
public Tab(File file, JTextArea container, JTabbedPane tab)
{
this.file = file;
this.container = container;
this.tab = tab;
tab.add(file.getName(), container);
readFile();
}
Now, in this SaveFile
class, I need get the Tab
values stored in the HashMap
. How can I do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…