jsr296

Java Application vs. Java Desktop Application in Netbeans [duplicate]

我们两清 提交于 2020-01-04 14:14:18
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Netbeans GUI editor generating its own incomprehensible code In Netbeans(older versions), there are two types of applications to choose from when you're starting a new project. Java Application and Java Desktop Application . What are the differences between these two types? EDIT : In newer versions of Netbeans, the Java Desktop Application is gone and only Java Application is available. Does that mean they have

org.jdesktop.swingbinding.JTableBinding$BindingTableModel cannot be cast to javax.swing.table.DefaultTableModel

纵然是瞬间 提交于 2019-12-31 04:40:06
问题 I tried to group JTable header and for that I want to get the DefaultTableModel of current JTable. But when I tried to retrieve the table model like this: DefaultTableModel dm=(DefaultTableModel) tblTet.getModel(); It shows the following exception: org.jdesktop.swingbinding.JTableBinding$BindingTableModel cannot be cast to javax.swing.table.DefaultTableModel Because I am using JTableBeansBinding. Does anyone know how to solve this problem (for retrieving DefaultTableModel)? 回答1: According to

Why can't I find Java desktop application in Netbeans 7.1

怎甘沉沦 提交于 2019-12-28 03:04:50
问题 I downloaded Netbeans 7.1 with all bundle from http://netbeans.org/downloads and installed it successfully on Windows 7. But I can't find Java Desktop Application which should be under Java category when add new project as 7.0 does. Where is it? Or what is the substitute one in 7.1? I need something to create GUI by dragging components. Thanks. 回答1: Look here: http://netbeans.org/bugzilla/show_bug.cgi?id=204661 Support for [B]SAF (JSR 296, basically the framework that was behind your "Java

Do JSR-286 portlets require a web.xml file in their WAR files?

与世无争的帅哥 提交于 2019-12-13 00:53:02
问题 Does the JSR 286 spec require the presence of a web.xml file in WARs containing portlets? At first, I thought so but then I created a portlet without a web.xml , deployed it in Liferay and it worked flawlessly. So is it an extension (or a bug) of Liferay, or is it not necessary to have such a file? 回答1: As Olaf rightly said portlet is nothing but a web application. Liferay has a listener that gets triggered when the portlet auto deploys. It explodes the war and adds web.xml and the content

Java unable to open pdf using Runtime

Deadly 提交于 2019-12-08 14:46:27
问题 I have to open a pdf on clicking a JMenuItem. I can open the pdf on click the menu item if i run my program from netbeans. But when i run from jar file it is not opening. I clean and build my project. But no change. Running when run from netbeans but not running from jar file. Do i need to add some library. My codes are as follows m_aboutItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Runtime rt = Runtime.getRuntime(); //System.out.println(Menubar1

How do I port a Java Desktop Application to Netbeans 7.1

半城伤御伤魂 提交于 2019-12-02 06:06:14
问题 In Netbeans 6, I wrote a fairly complex application based on the java desktop application (org.jdesktop.application. SingleFrameApplication). The Swing Application Framework has been removed from 7.1 and I now cannot edit the forms. I have been through the the examples of porting to the Netbeans Platform but they don't seem to cover migrating from a desktop application. Any help would be welcome. 回答1: Unfortunately the Swing Application Framework was deprecated and removed. It never became a

How do I port a Java Desktop Application to Netbeans 7.1

帅比萌擦擦* 提交于 2019-12-02 01:43:22
In Netbeans 6, I wrote a fairly complex application based on the java desktop application (org.jdesktop.application. SingleFrameApplication). The Swing Application Framework has been removed from 7.1 and I now cannot edit the forms. I have been through the the examples of porting to the Netbeans Platform but they don't seem to cover migrating from a desktop application. Any help would be welcome. Unfortunately the Swing Application Framework was deprecated and removed. It never became a final JSR, and at this point is fully dead (since JavaFX is considered the future of Java UIs). To make your

Get the application closing event

笑着哭i 提交于 2019-11-28 23:29:13
How to get to the application closing event? I want to get application to save all unsaved operations or show the user a message "Are you sure about closing without saving all data?" something like this. If this will be helpful - the application is a SingleFrameAplication using Swing. You could use a shutdown hook . It works for Swing, AWT and even console applications. Example: Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { //do your stuff } }); mKorbel You have to add WindowListener to your JFrame / JDialog , about closing event is there method public void

Get the application closing event

淺唱寂寞╮ 提交于 2019-11-27 14:50:30
问题 How to get to the application closing event? I want to get application to save all unsaved operations or show the user a message "Are you sure about closing without saving all data?" something like this. If this will be helpful - the application is a SingleFrameAplication using Swing. 回答1: You could use a shutdown hook. It works for Swing, AWT and even console applications. Example: Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { //do your stuff } }); 回答2: