开发者

how to get data on jlist created through design view on jframe in netbeans?

开发者 https://www.devze.com 2023-02-13 04:10 出处:网络
I am using Netbeans IDE for my project, I have created a jframe class, and from the design view I put a panel, on which I have put a jlist.

I am using Netbeans IDE for my project, I have created a jframe class, and from the design view I put a panel, on which I have put a jlist.

I开发者_运维问答 want to get the names of the databases from MySQL dynamically on to this jlist.

How can I do that?


Your JList is available as a variable inside your form class - just use, e.g. jList1.getModel().... and do what you want.

But there are database-viewing components for Swing, which will probably be easier than rolling your own database code (remember to close your PreparedStatements and ResultSets if you do).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号