How to launch swing app with jetbrains layouts in Netbeans - java

I've created app in IDEA with some swing layouts. I want to launch it in Netbeans in order to profile. But I get:
Exception in thread "main" java.awt.IllegalComponentStateException: contentPane cannot be set to null.
at javax.swing.JRootPane.setContentPane(JRootPane.java:603)
at javax.swing.JDialog.setContentPane(JDialog.java:991)
at TransTest.<init>(TransTest.java:44)
at TransTest.main(TransTest.java:284)
What files etc I should supply in order to run it?

As can be read on the UI designer webpage
Unique Byte-code instrumentation techniques allow you to get rid of complicated Swing code in your Java sources. IntelliJ IDEA's GUI-compiler transparently generates all necessary code needed to create and lay out form components. The GUI-compiler has been integrated into IntelliJ IDEA's make functionality, and is also available as a separate Ant task delivered together with the IntelliJ IDEA distribution. There is also an option to generate Java source code instead of using the byte-code instrumentation approach.
So generate Java source code and use that in NetBeans, or simply hand-code your layouts rather then using a UI designer.

Related

Completely remove the existence of a form for an IntelliJ GUI Designer UI build

I have created a GUI using the GUI Designer in IntelliJ IDEA, which includes the .form file as well as the bound class file.
The application runs as it is supposed to, and now I want to export the source files so that they can be used on other systems.
I know IDEA has the option to
Generate GUI into: Java source code
but this leaves me with remnants of intelliJ such as
$$$setupUI$$$() and $$$getRootComponent$$$()
Is there any way to have IDEA simply generate a class with a constructor or main that initializes the GUI, without relying on these sorts of seemingly unknown calls to unknown methods?
I just want to have my data members, generate them properly, and move on without these IntelliJ things.
Thanks for any assistance.
IntelliJ uses its own library to allow you to create GUIs visually, like in visual studio. Unfortunately, this means the form code you created only makes sense to this library. If you don't want to include the weird Java code or the dll, you will need to rewrite.

Is it possible to use SWT on Android-Studio or IntelliJ?

I've used Android-Studio for a long time, and I got used to it over Eclipse.
I wish to create an SWT app for PCs (windows, Linux, macOs) , and use a nice UI mechanism like Window-Builder that used to exist for Eclipse.
Is it a possible thing to do on Android-Studio or IntelliJ ?
If so, how?
There is no visual UI editor like WindowBuilder to create SWT UIs in IntelliJ.
But you certainly can create SWT applications with IntelliJ or any other non-Eclipse IDE for that matter. In my opinion, UI designer are overrated and UIs can be equally well implemented by hand. Thus if you are willing implement the UI in code you simply need to get a copy of the SWT library and you are set.
If you follow the redirects from this question it will guide you to maven artifacts of SWT:
maven project: SWT 3.5 dependency: any official public repo?
Note that SWT comes with a native part that might make extra settings necessary to launch your application.

Creating JFrame

We can create Java GUI based application using net-beans IDE and also we can create it using Notepad . Using netbeans or eclipse it is very easy . But I saw every where that every one used notepad. So I just want to know that the best way for create Java GUI application.
Its better preferring some IDE like Netbeans , Eclipse since because, you can consume time in creating the gui by utilizing the features like drag and drop, in-build function support suggestion which proper demonstration of usage and syntax.
If you are developing gui from scratch using notepad, it may takes more time, one developing things in that way should be thorough knowledge in syntax and all other functionalities
The Java Tutorials on Swing are a pretty good resource. If you don't like hand-coding your UI with Java code there are several GUI builders out there where you can lay out your UI visually and just fill in the behaviour in code-behind. E.g. Netbeans has such a thing and there is WindowBuilder for Eclipse.

Netbeans Project Types

I'm building a Java application using NetBeans 7.0. The app is intended for use on Windows, so I guess the tool I'm really making most use of is Java Swing (for the cool, nifty screen elements).
My question relates to NetBeans' process of creating the various project types. The application I'm building is based on the "Java Desktop Application" template (?). My problem is that there seems to be a nice load of bloat built into that, and I can't figure out how to remove most of it without blowing up the app.
As a test, I created a "Java Application"project, but this has the opposite problem -- there's absolutely nothing built into the code, and I can figure out how to add anything. Specifically, a Java Desktop Application project created in NetBeans give me the ability to directly edit the screen layout like in Visual Studio. However, a Java Application does not appear to have this capability, I have no idea how (or even if) this can be addressed.
If I could start with a no-frills Java application, and add some capability to edit its layout and control the function of the screen elements (i.e. make it a windows application, I think), that would be just about perfect.
Does anybody have a suggestion for a minimal, but functional NetBeans application start point??
Thanks,
R.
If you start with a plain Java Application then as you realize you start with a bare bones type application. To add a GUI you can add New>JFRame Form. It adds a class that extends JFrame and Netbeans will recognize that it should open it in the visual editor for you.

java debugging library

I'm searching for a debugging framework that can be used to implement the UI portion of the debugger - elements like windows, watches, source view, popup menus, etc. Ideally I should be able to just write some glue code between my backend (which provides disassembly, memory access, etc) and this "framework", and end up with a debugger.
I am not looking to debug java code itself - rather want to lift the UI and what not. :)
Any suggestions? I've found jswat, but not sure how easy it will be to integrate with its GUI component, cause its based on netbeans and might require a lot of glue code. I need a fairly basic debugger that can be integrated into my own project - rather than a standalone tool.
What about using jdb (http://download.oracle.com/javase/6/docs/technotes/tools/solaris/jdb.html), source code, according to Oracle is available:
Full source code for jdb is included
as part of the example code in the
Java 2 SDK's lib/jpda directory
You could hack it so instead of printing to the console, you can get the messages and print them in your UI.
If I am getting your question right, specifically, you can use the Visual Debugger in Java Swing and JavaFX GUI applications on NetBeans for example. by starting your debugging session and go to Debug> Take GUI Snapshot.
When you choose Take GUI Snapshot, the IDE will take a snapshot of the GUI and will open it in the main window.
This provides a way for you to locate the code based on the GUI instead of searching through the code.

Categories

Resources