This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
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

JPanel inside JDialog and without  RSS feed

 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my application has a JDialog, with a component (between others)a added inside that is subsubsubsubclass of JPanel (furtheron jpanel). After separating that jpanel from JDialog, I have problems:

  1. to visualize (show(),update(), setVisible(true)), etc.


  2. But what is more intriguing, during debugging, application is just stopping inside catch of SQLException, instead of advancing further like it was before I separated this instance of jpanel from jdialog. Debugging revelas that the application stucks inside empty catch block!
    and after some recoding around , still inside catch of SQLException block...

  3. I also do not instantiate JDialog directly but through a chain of instantiations...
    Any comments?

    [This message has been edited by G Vanin (edited October 30, 2001).]
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
whats this SQLException? what says the StackTrace?
post the relevant code.
chantal
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Chantal,
java.sql.SQLException, you may consult http://dpinid03.iapmei.pt/p3/manuais/docs/api/index.html
There is no printStackTrace() in catch() but if to insert it then it gives exactly the same in working and dying variants.
Try-catch is just obligatory because
ResultSet executeQuery() throws SQLException;
throws it.
Then someone has used SQLException just to determine the absence of needed value in the table and put in corresponding GUI TextField "N�o atribuido"
The problem that no changes was done inside the instanceOfJPanel class (it has also treatment of JDBC access). I regret that I mentioned SQLException at all. The question was about Swing components tricks and it is abt this this thread is, isn't it?
I doubt that it will be helpful to post here a few MB of code

[This message has been edited by G Vanin (edited October 31, 2001).]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have a sub-class of JPanel in a JDialog... which is having trouble displaying... and a SQLException is being thrown. Is the SQLException being thrown repeatedly in the constructor of the JPanel? This would explain why it doesn't display correctly... As far as an exception getting "locked up" in an empty catch statement... that simply does not happen... it either propagates to a higher try/catch block, and if not caught, then exits the program. Is the try/catch in a loop, or does the catch try to execute the process over? That is the only way you are going to get the behavior you describe...

Besides... it would really help if you posted some code... mostly just code where you are adding the JPanel to the JDialog, launching the JDialog, and the code in the area that gets the SQLException, and any relevant code that calls that area...

-Nate
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Nathan,
I just wanted to eMail you some code files, but I cannot get neither your Email nor profile. I shall go now to JavaRanch to post there the technical questions about functioning of this site.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked for me nate@javaranch.com. Are you seeing the icons by the date/time?
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but the buttons do not function.
Then it is not the problem of the site. I currently started to have multiple problems with my Windows2000 Adv. Server. The previous owner installed it, and nobody has its installation CD. The problem is that, in order to minimize memory use, I disabled too many sevices in Administration Tools - Services and I can't enable them back, the fram of "Properties" of a service just does not appear!
The problem is that I did not notice any problems since I was not shutting down for weeks and now it appears all of a sudden...
I also cannot make: the copy-paste (in MS applications), copying files, Drag&Drop,print files, etc.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!