• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

java components not getting redrawn

rainypickles

Senior member
hi

i am working on an application. it opens a JFrame and i put a JPanel on the frame. i set the panel layout to null and put classes (extended from canvas) all over the place. i made it so that pressing the arrow keys will cause one canvas to move around. all that works fine.

i tried adding JCheckBoxes to the panel. i add them, and they appear when i mouse over them. when i move my canvas over them, they disappear and dont get redrawn. i changed to Checkboxes (older awt) and this problem does not occur.

then i tried adding a JProgressBar on there and had the same problem. since the old awt didnt have progress bar, i want to use JProgressBar. (i dont want to code my own bar; but maybe itll be easy anyway).

so, how do i make the swing components redraw themselves? there had better be an easy way. is there a paintAllComponents method? i dont think i saw it.

thanks.
 
Back
Top