Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1003378 // revalidate - update & repaint a component/frame after any change

JavaX fragment (include)

static <A extends Component> A revalidate(final A c) {
  if (c == null || !c.isShowing()) ret c;
  swing {
    // magic combo to actually relayout and repaint
    c.revalidate();
    c.repaint();
  }
  ret c;
}

static void revalidate(JFrame f) { revalidate((Component) f); }
static void revalidate(JInternalFrame f) { revalidate((Component) f); }

Author comment

Began life as a copy of #1001528

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003378
Snippet name: revalidate - update & repaint a component/frame after any change
Eternal ID of this version: #1003378/7
Text MD5: dd0a4172ed9db07a31ad51d4af48a3b4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-15 04:03:20
Source code size: 358 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 831 / 886
Version history: 6 change(s)
Referenced in: #1004142 - revalidateFrame - relayout & repaint a whole frame
#1006654 - Standard functions list 2 (LIVE, continuation of #761)