Can we bundle applet class as virtual app using Jwrapper - jwrapper

when I am trying to define my applet as Main class
<JWrapper>
<!-- The name of the app bundle -->
<BundleName>MemoryMap</BundleName>
<!-- The specification for one app within the bundle -->
<App>
<Name>MemoryMap</Name>
<LogoPNG>sampleapp/logo.png</LogoPNG>
<MainClass>com.example.SampleApplet</MainClass>
</App>
getting below exception
Caused by: java.lang.NoSuchMethodException: com.example.SampleApplet.main([Ljava.lang.String;)
Not sure if we cannot define applet class as main class , does that mean Jwrapper could not bundle Applet?
Please suggest..

Its not possible to specify an Applet or JApplet as the main class in a JWrapper application however converting an Applet or JApplet to a standalone class is usually a simple process of just creating a JFrame and embedding the applet UI into it, then specifying a main method to launch the JFrame.
Here's an example:
http://www.coderanch.com/t/337839/GUI/java/Convert-Applet-Stand-app

Related

Making class library project visible to another .net project

Hello i have a solution with an .net-core app and a class library.How can i make the class library's classes visible to the .net-core app without declaring all of them public ?
Should i just use the InternalsVisibleTo ?

Uber jar with ehcache breaks with Swagger

For a Dropwizard application, a Uber-jar is created using maven-shade-plugin. When I try to start it, the Bootstrap class loading done by swagger (dropwizard-swagger bundle) breaks trying to load the classes inside ehcache jar. These classes have a custom class loader, and are inside a folder in the jar with a different extension (.class_terracotta).
- Is there a way to tell Swagger/Reflections to use a Custom classloader so that it can resolve these classes?
- Is there a way to exclude the classes from the scanning, so that it does not attempt the loading?

How to change application name when deploying native self contained applications with javafx?

I am using JavaFX ant scripts to generate native bundles. The generated native executables use the name of the Main class. Is there any way to specify what the executable name should be? short of renaming the Main class?
I've scoured the Internet but have failed to find a configuration option that will do this. The specific reason I am running into this problem is that I am using another library (getdown) to launch my application, and because if this my main class name is the name of the Getdown main class, which will be confusing for my users.
The <fx:application> element of the <fx:build> target in build.xml defines a name attribute that is used for the application title. I.e. you can do
<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}"
nativeBundles="all"
outdir="${basedir}/${dist.dir}" outfile="${application.title}">
<fx:application name="My Cool App" mainClass="${javafx.main.class}"/>
<!-- ... -->
</fx:deploy>
See the official documentation for more details.

javaFX 2.0 XYChart and CSS

I am new to JavaFX 2.0 and to do practice I have followed the Oracle example about Line Chart (Stock Monitoring)
http://docs.oracle.com/javafx/2.0/charts/line-chart.htm#CIHGBCFI
Now I would like to ad a CSS class in the same package to modify Stroke, color, etc but I can't succed.
Searching here on StackOverflow I have found
scene.getStylesheets().add(this.getClass().getResource("linechart.css").toExternalForm());
but I still get errors
Exception in Application start method Exception in thread "main" java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
My java class name is JavaFXApplication2 and CSS class name is linechart.css
Would someone be so kind to explain me where I am wrong?
There is another nice tutorial about the CSS use with Stock Monitoring example here
http://docs.oracle.com/javafx/2.0/charts/css-styles.htm
but I do not know how to add the CSS examples to the java class
Thanks
I suspect that the css file is not being copied to the folder where the java files are compiled. Are you using an IDE? Can you add this line to your app System.out.println(this.getClass().getResource(".").toExternalForm());
and copy the css file to the folder path printed by this line.
You can build the project or copy the css file to the build path.If you using netbeans,you must build the project once after new resource file added.

Problem modulating action script project

I am refactoring a hugh action script solution in Flash builder (beta 2) using the flex 4 sdk.
The project does NOT use the mx framework.
What i want to have is:
A big 'MAIN' project
several small 'MODULE' projects. each 'MODULE' class refrences the 'MAIN' project as an External reference (doesnt compile into swf) - this is done by setting link type = external in the 'MODULE' project properties -> library path.
'MAIN' loads a 'MODULE' project on runtime using the 'loader' class.
the problem:
I recieve an error from the MODULE project:
VerifyError: Error #1014: Class [some class in MAIN] could not be found.
PLEASE HELP!
Check which application domain you are loading your module into. The app domain needs to be able to access the class you have externalised or you'll get that error.
It might just be a bug with the beta version of the sdk. It seems like the import of a class in a module created in another project doesn't force it's inclusion in the main swf.
try putting a dummy dependency in you main application class, like:
private var forcedImports:Array = [MyClass];
It fixed some of my problems before.

Resources