Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem displaying JScrollPane with custom gradient paint  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a node is clicked on, then a node is expanded, the JTree is shifted a litte bit
to the left, I don't want that to happen.
I'd like to have the JTree stay at the top left corner, then when
expanded and not enough space, there will be a horizontal scroll bar
How do I achieve that?
Thanks
Jack
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works correctly for me.
I created a JTree, wrapped it in a JScrollPane and added it to the panel.

Post your SSCCE code which demonstrates your problem
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Works correctly for me.
I created a JTree, wrapped it in a JScrollPane and added it to the panel.

Post your SSCCE code which demonstrates your problem


Here is the SSCCE, it scrolls, but the gradient is not working




Thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jacky Luk wrote:Here is the SSCCE, it scrolls, but the gradient is not working

This is not what you stated originally.
Jacky Luk wrote:When a node is clicked on, then a node is expanded, the JTree is shifted a litte bit
to the left, I don't want that to happen.

I tried the SSCCE you posted and I did not observe any "shifting"

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:
Jacky Luk wrote:Here is the SSCCE, it scrolls, but the gradient is not working

This is not what you stated originally.
Jacky Luk wrote:When a node is clicked on, then a node is expanded, the JTree is shifted a litte bit
to the left, I don't want that to happen.

I tried the SSCCE you posted and I did not observe any "shifting"



I wonder why no seen thru is established, I want to have a gradient background
Sorry for changing the topic. Am I allowed to change the title of the thread?
thanks
Jack
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I adjusted it for you.
When you wish any custom paint to show, you need to make all components on top of it transparent


Notice the calls to


 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh.. I see
Thanks
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!