1

im making a simple editor with use of JTabbed pane, i have a minor problem though. when i hover over the name of the tab(i enclosed a screenshot) everything inside the tab is repainted and for whatever reason it is not painted again(lets say i have a couple of elements stored in arraylist(the green circles - JPanels) and in paint method i iterate through whole list and paint ALL the elements, so when repaint is called on hover everything should be there again, but it ISNT, i even debugged it and the whole array is iterated over and every object(circle) is added to the drawing panel). SO i need to know why my elements arent painted again, or disable the repaint on hover. i enclose a screenshot: screen --the repaint occurs when i hover over NET 1

Hižko Hiiž
  • 51
  • 1
  • 5
  • 2
    There's certainly a bug present, but I'm not sure if we'll be able to help you based on the information provided so far. Best if you could post a *small* compilable runnable program that requires no files/database/outside resources, and which reproduces your problem, an [sscce](http://sscce.org). – Hovercraft Full Of Eels Apr 01 '12 at 14:37
  • 1
    Using Nimbus on Mac OS X, see if this [example](http://stackoverflow.com/questions/5773874) shows the anomaly. – trashgod Apr 01 '12 at 14:45
  • 1
    Just a small suggestion, instead of overriding `paint(...)` try to override `paintComponent(...)` that's it, no more change(just rename your paint to paintComponent), and see does the same phenomenon shows again !!!! – nIcE cOw Apr 01 '12 at 14:49
  • okay Hovercraft here is the full netbeans project [link](http://cl.ly/2Y1q41451O3P3z3V2j1H) ...only add place is working so far how i want it so just put a couple of places in a tab and then hover over Net 1 and you will see the problem...thanks man, this will help a lot if you find a solution. – Hižko Hiiž Apr 01 '12 at 14:51
  • 1
    @HižkoHiiž: hopefully one of the volunteers will have lots of free time to go through your full netbeans project code. Myself, I have projects to do for my wife and family as well as work. If you don't get a decent answer soon, again consider creating a small minimal necessary code version that shows the problem, runs for us and has no code present unrelated to the problem. Yes it's asking a bit of effort from you, but then you're asking a bit of effort from us, so it is a fair trade I think. – Hovercraft Full Of Eels Apr 01 '12 at 14:56
  • okay maybe i scared you off with "full netbeans project" - but if you look at it there are only a couple of classes implemented and you only need to look at Place, DrawPanel, Editor - so far the whole project does only 1 thing - adds places to the panel and then i discovered the bug so i wanted to solve it in the beginning - so so far i consider the whole project for "small minimal necessary code". – Hižko Hiiž Apr 01 '12 at 15:05
  • @Hižko Hiiž there is Nimbus L&F ??? of Custom Look and Feel based on Nimbus ???, – mKorbel Apr 01 '12 at 15:23
  • i never used nimbus look and feel and dont know what exactly it is, pure netbeans project with 1 JFrame and a couple of JPanels.. – Hižko Hiiž Apr 01 '12 at 15:28
  • @Hižko Hiiž then from where came picture you sticked here ???, sure I don't awaiting any answer by your side – mKorbel Apr 01 '12 at 15:37
  • i dont know what you talkin about :D if you mean the icons on buttons i set it in the icon property, in netbeans Design view. – Hižko Hiiž Apr 01 '12 at 15:46
  • if you mean the picture i sticked here i use osx Cloud app and just posted a link here – Hižko Hiiž Apr 01 '12 at 15:47

0 Answers0