IntelliJ IDEA - GUI Designer - Cannot load Preview form - java

I have a real trubble for a beginner)
When I try to see Preview while working in GUIform (even when class is empty), I see an error:
Cannot preview form '.../SimpleG.form'
Reason: cannot load /com/intellij/uiDesigner/FormPreviewFrame.class
// I have installed plugin JFormDesigner and didn't find how/where to install UIDesigner plugin.
Project SDK 1.8;
Project language level SDK default (8)

Looks like IDEA-237293. Will be fixed in the next release (around May 26th).

Related

How do I set up Logitech's LED Illumination SDK with Java?

When a make a simple test program with Logitech's LED SDK and run it, I get an UnsatisfiedLinkError with the message:
C:\Users\cwa38\AppData\Local\Temp\LogitechLedJNI.dll4587977834410494064: Can't find dependent libraries
What I have done so far:
I downloaded the SDK from https://www.logitechg.com/en-us/innovation/developer-lab.html
I extracted it
I made a new Java project in NetBeans
I added the logiled.jar file to my new project as a dependency
I made a new class and copied the simple test program from the documentation (code is below)
I clicked "run" and got the UnsatisfiedLinkError described above
I see that the SDK download comes with some .dll files and a .lib file, but I have no idea what to do with these files. The included documentation makes absolutely no mention of them.
What am I doing wrong?
Here is my code:
import com.logitech.gaming.LogiLED;
public class Main {
public static void main(String[] args) {
LogiLED.LogiLedInit();
LogiLED.LogiLedSetLighting(100, 0, 0);
LogiLED.LogiLedShutdown();
}
}
And here is the full documentation from Logitech (yes, it really is this short):
The following steps show how to make the Logitech SDK work with a Java program. Please adapt the steps to your game for things to work.
Steps
Copy the SDK’s Lib\logiled.jar to your project’s directory.
Configure your project’s Java Build Path to include the logiled.jar.
Call the functions from the JNI wrapper in your Java code as follows:
import com.logitech.gaming.LogiLED;
LogiLED.LogiLedInit();
LogiLED.LogiLedSetLighting(red,blue,green);
LogiLED.LogiLedShutdown();
Compile and run your program.
The full stack trace for the error I get is below:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\cwa38\AppData\Local\Temp\LogitechLedJNI.dll4587977834410494064: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at com.logitech.gaming.LogiLED.<clinit>(LogiLED.java:205)
at javaapplication1.JavaApplication1.main(JavaApplication1.java:20)
C:\Users\cwa38\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\cwa38\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:68: Java returned: 1
I tried to run your project in my netbeans but failed with
project com.cwa380:KeyColors:jar:1.0: logitech:gaming:jar:9.00 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
then I created a new project from ant, as long as you are using this logitech jar which is not really in maven repository, you dont need to have maven project.
then I added the logiled.jar as image below
good news when I run the code I get no exception. output below
and when I try to use code completion netbeans lists the functions nicely.
here are my versions of tools
Product Version: Apache NetBeans IDE 12.4
Java: 17; OpenJDK 64-Bit Server VM 17+35-2724
Runtime: OpenJDK Runtime Environment 17+35-2724
System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\ozkan\AppData\Roaming\NetBeans\12.4
Cache directory: C:\Users\ozkan\AppData\Local\NetBeans\Cache\12.4
in github I found https://github.com/larsgrefer/logi-led you may contact with Lars(#larsgrefer), looks like he knows how to use logitech SDK.
here is my project https://github.com/ozkanpakdil/spring-examples/tree/master/JavaApplication1 make sure you have added logiled jar in correct path to libraries

SWT: Method Monitor#getZoom() cannot be found

The org.eclipse.swt.widgets.Monitor class is supposed to have an instance method called getZoom, which should return the zoom factor set on the particular monitor. It is documented here (after clicking on "Monitor"):
https://help.eclipse.org/2021-03/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/widgets/package-summary.html
However, when trying to compile the following code...
Monitor monitor = Display.getDefault().getPrimaryMonitor();
int zoom = monitor.getZoom();
..., I get an error saying:
java: cannot find symbol
symbol: method getZoom()
location: variable monitor of type org.eclipse.swt.widgets.Monitor
The method is documented to exist since SWT version 3.107, and I'm using version 4.6.1. All other methods of the Monitor class work as expected.
What am I missing here?
(If there is further information needed to answer this question, please feel free to ask.)
SWT versions do not match Eclipse versions. 4.6.1 is your Eclipse version (Eclipse Neon), this contains SWT version 3.105.1 which is too old.
SWT 3.107 was first included in Eclipse 4.8 (Eclipse Photon). I think later versions extend the platforms on which zoom is supported so you should try to move to the current Eclipse 2021-03 (2021-06 shortly)

Vaadin 8: error java.lang.NoSuchMethodError: com.vaadin.ui.MenuBar.addItem with GridContextMenu 3

I am trying to make the Vaadin plugin GridContextMenu work on my project. I am using version 8.7.1 of Vaadin, recently migrated from an earlier version 7.
I first used version 2 of the context menu but did not get any visible results. So I tried to take the latest version. I now get the following error:
java.lang.NoSuchMethodError: com.vaadin.ui.MenuBar.addItem (Ljava / lang / String;) Lcom / vaadin / ui / MenuBar $ MenuItem;
I tried to clean the caches of Maven and my IntelliJ, my local .m2
and recompile my widgetset etc... But I always get the same error.
Here is the line of code causing the problem :
GridContextMenu<VehiculeImmat> gridContextMenu=new GridContextMenu<>(this);
Has anyone ever gotten that problem or an idea of ​​how to solve it?
Hy,
This is causing due to API version mismatch as GridContextMenu is moved to package com.vaadin.v7.contextmenu so try to change import package.
ContextMenu v3.0 is rewritten so they have changed some package hierarchy but it compatible with Vaadin7 and 8.
Further see API doc and release notes on following link
https://vaadin.com/directory/component/vaadin-contextmenu/api

Smartwatch 2 - Cannot compile sample project even

I wanted to start developing for the Sony Smartwatch 2 I just got.
This is where the problems started. I found many official articles about downloading and setting up the Sony Add-on SDK.
But here's the dark side:
It is not available anymore from Sony's dev site, so I could not add it by using the Android SDK manager .
After lots of sweat I managed to find it only here.
Which is the 2.0 version.
I unzipped it into my /[SDK]/add-ons/sony_add-on_sdk_2_0 folder, and set up Eclipse (4.6.3) with the following SDK manager settings:
SDK settings
First it reported the Sony SDK broken, but I found in another topic that I should add a source.properties file, in order to make it work, which has the following header:
### Android Tool: Source of this archive.
#Wed Feb 28 14:14:39 CET 2018
Addon.NameDisplay=SONY ADD-On SDK
Addon.NameId=sony_add_on
Addon.VendorDisplay=SONY
Addon.VendorId=sony
AndroidVersion.ApiLevel=16
Pkg.Desc=Android + Google APIs
Then it became visible for the Eclipse
When I try to build the SamplePreferenceActivity it is imported with SmartExtensionsAPI and SmartExtensionsUtils but one after the other as I read this can make errors too, in the following order:
API
Utils
Sample
which has the following properties:
Properties for SmartExtensionAPI
Properties for SmartExtensionUtils
With these settings I still get error in:
/SmartExtensionUtils/src/com/sonyericsson/extras/liveware/extension/util/widget/NotificationWidgetExtension.java
saying
SmartWatchNotificationWidgetImage cannot be resolved to a type
and in
/SamplePreferenceActivity/res/layout/item_gallery.xml
saying:
Couldn't resolve resource #style/Widget.Holo.ActionMode Couldn't
resolve resource #dimen/smart_watch_2_control_width You must supply a
layout_width attribute. Couldn't resolve resource
#dimen/smart_watch_2_text_size_large
"#dimen/smart_watch_2_text_size_large" in attribute "textSize" is not
a valid format. Couldn't resolve resource
#dimen/smart_watch_2_text_size_medium
"#dimen/smart_watch_2_text_size_medium" in attribute "textSize" is not
a valid format.
What am I missing here? Should I use a completely different setup? Is this because I had to manually add the SDK to Eclipse? If you need anything else to understand the problem properly, feel free to ask me, thanks for helping me!

Libgdx & RoboVM to app store

I can compile and run my game using LibGDX 0.9.9 and RoboVM 0.0.7
I have been able to build an ipa for app store submission. Uploading my app with Application Loader, I get an error saying: This bundle is invalid. Apple is currently not accepting applications built with this version of Xcode.
Adding
<key>DTXcode</key>
<string>0502</string>
<key>DTXcodeBuild</key>
<string>5A3005</string>
to my info.plist, I get the same app store submission error.
I have tried compiling my project with every combination of the following libraries
LibGDX 0.9.9
LibGDX Nightly - 02/13/14
RoboVM 0.0.8
RoboVM 0.0.9
RoboVM 0.0.10-SNAPSHOT
With any version of RoboVM greater than 0.0.7, I get the following error:
java.lang.IllegalArgumentException: No #Marshaler found for parameter 1 of #Callback method <com.badlogic.gdx.backends.iosrobovm.objectal.AVAudioPlayerDelegate$Callbacks: void didFinishPlaying(com.badlogic.gdx.backends.iosrobovm.objectal.AVAudioPlayerDelegate,org.robovm.objc.Selector,org.robovm.cocoatouch.foundation.NSObject,boolean)>
at org.robovm.compiler.MarshalerLookup.findMarshalerMethod(MarshalerLookup.java:167)
at org.robovm.compiler.BroMethodCompiler.getParameterType(BroMethodCompiler.java:492)
at org.robovm.compiler.BroMethodCompiler.getBridgeOrCallbackFunctionType(BroMethodCompiler.java:513)
at org.robovm.compiler.BroMethodCompiler.getCallbackFunctionType(BroMethodCompiler.java:505)
at org.robovm.compiler.CallbackMethodCompiler.callback(CallbackMethodCompiler.java:78)
at org.robovm.compiler.CallbackMethodCompiler.compileCallback(CallbackMethodCompiler.java:107)
at org.robovm.compiler.CallbackMethodCompiler.doCompile(CallbackMethodCompiler.java:74)
at org.robovm.compiler.AbstractMethodCompiler.compile(AbstractMethodCompiler.java:74)
at org.robovm.compiler.ClassCompiler.callbackMethod(ClassCompiler.java:1070)
at org.robovm.compiler.ClassCompiler.compile(ClassCompiler.java:566)
at org.robovm.compiler.ClassCompiler.compile(ClassCompiler.java:283)
at org.robovm.compiler.AppCompiler.compile(AppCompiler.java:198)
at org.robovm.compiler.AppCompiler.compile(AppCompiler.java:216)
at org.robovm.compiler.AppCompiler.main(AppCompiler.java:438)
I'm at a loss. I just want to submit my app to the Apple App Store. RoboVM 0.0.7 doesn't seem to work and I can't compile my project with any newer version of RoboVM. Let me know if you need any more information.
How can I submit my app using RoboVM 0.0.7 (emulate Xcode 5.2)?
or
How can I fix my error and compile with >0.0.7?
The bundle is invalid problem was fixed in RoboVM 0.0.9 so you must use at least that version. The cause of the No #Marshaler found error is probably because you have an old version of robovm-cocoatouch.jar in your classpath somewhere. Make sure you only have jars from RoboVM 0.0.9 in your Eclipse classpath.

Categories

Resources