Win a copy of Spring Boot in Practice this week in the Spring forum!

David McCormick

Greenhorn
+ Follow
since Jun 26, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David McCormick

I couldn't find anything in the archives related to this, so I apologize in advance if this has already be answered.
I don't know if this is the case in environments other than Windows, but I notice that Java applications take a relatively long time to repaint their screen after they regain focus. Is this the price to be paid for using a Java application or is there something that could be set in the JVM or the code to make it more responsive?
Thanks.
20 years ago
Check out manning.spindoczine.com/sbe which has the online version of Matthew Robinson's "Swing". Chapter 16 talks about JInternalFrames.
21 years ago
and that it will be probably not be in a future version of the API.
21 years ago
or try this:
c:\>java NoLDS.webstrms.ServerStream
which uses the full package name. I find it's easier for me to understand how the class fits within its package structure this way.
21 years ago
Has anybody ever figured out how to build an MDI interface with a Windows menu? I've seen an example on JavaWorld (mditest) but it doesn't sync the Windows menu with the JInternalFrames. I've tried this:
JMenu fileMenu = new JMenu("File");
fileMenu.setMnemonic('f');
mb.add(fileMenu);
JMenuItem newItem = new JMenuItem("New");
newItem.setMnemonic('n');
ActionListener lst = new ActionListener() {
public void actionPerformed(ActionEvent e) {
JInternalFrame jif = new JInternalFrame("Document" + ++frameCount, true, true,
true, true);
Dimension d = desktop.getSize();
jif.setBounds(frameCount * 25,frameCount * 25, d.width/2, d.height/2);
jif.show();
desktop.add(jif);
desktop.moveToFront(jif);
if (windowMenu == null) {
windowMenu = new JMenu("Window");
windowMenu.setMnemonic('w');
mb.add(windowMenu);
}
JMenuItem windowItem = new JMenuItem(frameCount + ". Document" + frameCount);
windowMenu.add(windowItem);

}
};
newItem.addActionListener(lst);
fileMenu.add(newItem);
but I can't figure out how to put a listener or action on the JMenuItem that ties it to a particular JInternalFrame.
Thanks in advance.
21 years ago