Returns the window (a Frame or a Dialog) with the specified title, or null if a window with that title is not found.
(String title)
| 538 | /** Returns the window (a Frame or a Dialog) with the specified |
| 539 | title, or null if a window with that title is not found. */ |
| 540 | public static Window getWindow(String title) { |
| 541 | for (int i=0; i<nonImageList.size(); i++) { |
| 542 | Object win = nonImageList.get(i); |
| 543 | String winTitle = win instanceof Frame?((Frame)win).getTitle():((Dialog)win).getTitle(); |
| 544 | if (title.equals(winTitle)) |
| 545 | return (Window)win; |
| 546 | } |
| 547 | return getImageWindow(title); |
| 548 | } |
| 549 | |
| 550 | /** Obsolete; replaced by getWindow(). */ |
| 551 | public static Frame getFrame(String title) { |
no test coverage detected