Witam
Pisze program Notepad z opcja Open i kilkoma JInternalFrame.
Posiadam klase ktora tworzy mi moje JInternalFrame w JDesktopPane
Kazde JInternalFrame posiada JTextArea rowniez tworzone w tejze klasie.
Pytanie jak zrobic aby program wiedzial ktore JIternalFrame jest aktualnie aktywne
Bo jak na razie zawsze wczytuje mi plik do ostatnio utworzonego JInternalFrame
Moja klasa
class MyInternalFrame extends JInternalFrame implements FocusListener {
static final int xPosition = 30, yPosition = 30;
public MyInternalFrame() {
super("Okno #" + (++frameNumber), true,true,true,true);
setSize(300, 300);
text = new JTextArea();
text.addFocusListener(this);
setLocation(xPosition * frameNumber, yPosition
* frameNumber);
}
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {
}
Nie dokonca mam pojecie jak sie zabrac za ustawianie Focusa
i czy to jest problem focusa za wszelkie podpowiedzi bede wdzieczny.