Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

XOR on the transparent glassPane, XOR Alternative, JScrollPane Thumbs  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I want to do something similar to 'rubber band' animation (using potentially many colors) on a panel that has many things drawn on it (again many colors). When I draw/erase these using XOR drawing mode I can not control the color satisfactorily because I have a multi-colored background. Clearing and redrawing is just too ooogly.
I thought that doing the XOR drawing on the glassPane would be a good way to go but it's not working out for me.
My questions...
1) When the glassPane is setOpaque(false) what is the color of the (disabled ?) getBackground() ? Can you XOR on a transparent glassPane ? How ?
2) If I decide to just clear the glassPane and rewrite, how should I best accomplish that. I tried .clearRect but it drew Gray, over borders and other controls, etc. (even though I had specified opaque==false).
3) Any better way to do this kind of 'painting animation' than what I'm thinking of ?
Also, and I apologize for these two disparate subjects in advance, I was bejiggered all weekend trying to get a JScrollPane to show me the dadgummed thumbs. I have extended JFrame, created a JPanel (2000,2000) and used it to instanciate a JScrollPane. I have the hole thing working, column and row viewports and active corners...but I simply can not get the JScrollPane to think it needs the scrollbars (in fact, they disappear if I don't specify ALWAYS).
Thanks very, very much in advance.
Best Regards,
Tim
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!