1 | static JFrame renewFrame(final JFrame frame) { |
2 | if (frame == null) null; |
3 | ret (JFrame) swing(func { |
4 | Container content = frame.getContentPane(); |
5 | JFrame frame2 = makeFrame(frame.getTitle()); |
6 | frame2.setBounds(frame.getBounds()); |
7 | pcall { frame2.setIconImages(frame.getIconImages()); } |
8 | frame2.setDefaultCloseOperation(frame.getDefaultCloseOperation()); |
9 | bool active = isActiveFrame(frame); |
10 | frame2.setAutoRequestFocus(active); |
11 | for (WindowListener wl : frame.getWindowListeners()) |
12 | frame2.addWindowListener(wl); |
13 | frame.setContentPane(new JPanel); |
14 | frame2.setContentPane(content); |
15 | frame2.setVisible(true); |
16 | frame.dispose(); |
17 | ret frame2; |
18 | }); |
19 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007068 |
Snippet name: | renewFrame - upgrade frame title to current look&feel |
Eternal ID of this version: | #1007068/18 |
Text MD5: | d9760a59b5c04294be48b129f9001476 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-26 13:47:54 |
Source code size: | 708 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 533 / 546 |
Version history: | 17 change(s) |
Referenced in: | [show references] |