AWT
Not relevant
AWT is presently unsupported.
public override java.awt.Graphics2D createGraphics()
{
//Graphics g = Graphics.FromImage(bitmap);
// HACK for off-screen images we don't want ClearType or anti-aliasing
// TODO I'm sure Java 2D has a way to control text rendering quality, we should honor that
//g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
return new BitmapGraphics(bitmap, this, getFont(), J2C.ConvertColor(getForeground()), J2C.ConvertColor(getBackground()));
}
https://github.com/ikvm-revived/ikvm/blob/733723d5ab05fc3209d7a58ea27eb5106714de5f/src/IKVM.AWT.WinForms/images.cs#L122
It's not supported on Windows either.
AWT is a windowing toolkit. I can't quite figure out what you're suggesting.
Headless mode might work.
Will leave this issue around to discuss eventual AWT support.
Ideas:
First off, I think abandoning the existing WinForms support is probably the right thing to do, at least for now. It needs a serious reassessment for Core anyways.
I think a better initial strategy would be to port the actual OpenJDK AWT toolkits to IKVM. They consist currently of mostly native callouts to existing Windowing libraries: Win32, GTK, etc. I think it would be fine to consider compiling the actual C of this, and having it distributed in some separate OS specific packages. IKVM.Java.AWT.Windows, IKVM.Java.AWT.GTK, or something.
Given how well JNI works, this shouldn't actually be much of a problem. We get to make the thing work while not having to write much code of our own.
If somebody wants to, they can implement a managed AWT toolkit.
I don't know what that error is in reference to. You're going to have to be more specific.
AWT is not supported.......
IKVM.AWT.WinForms, which is the AWT toolkit implemented on top of WinForms. It was never a very well-completed project, and ended up pretty broken on Core. Not to mention completely non-cross platform.
I don't understand the question. Do what? This thread is about AWT, but none of your questions seem to have to do with AWT.
If somebody wants to fix IKVM.AWT.WinForms, they can. It's not on my list of things to work on.
If somebody wants to get the Sun/Oracle native AWT toolkits compiling, they can. But also, not really a focus of mine.
@wasabii
Thank you, the ported .NET Core IKVM has performed better than my previous experience with .NET Framework when dealing with computing complex images.
WIP
Instead of creating Panel and Form, work on mapping java.awt.* { image, font, graphics } to .Net core version ikvm.awt { image, font, graphics }
-
[ ] ikvm.awt.NetToolkit
public sealed class NetToolkit : sun.awt.SunToolkit, ikvm.awt.IkvmToolkit, sun.awt.KeyboardFocusManagerPeerProvider
-
[ ] ikvm.awt.NetGraphicsConfiguration
-
[ ] ikvm.awt.NetGraphicsEnvironment
-
[ ] ikvm.awt.NetGraphics //
java.awt.Graphics2D//sun.java2d.SunGraphics2D
There are from the Nuget (.NETFramework) distributed by https://github.com/windward-studios/ikvm8



@NightOwl888 @wasabii Why in ikvm-revived these are not included in Ikvm.Runtime.JNI?
- ikvm-native-win32-x64
- ikvm-native-win32-x86
Could we have a Window platform version of Ikvm-revived to slowly figure out why IKVM.AWT.WINFORM is not working?
Ikvm WINWARD

ikvm-revived

@jfrijters
Not sure if you are still around, if so, do you think it is feasible to make IKVM.AWT.WinForm to work ONLY for Windows under .NET Core?
@NightOwl888 Can someone show me how to run and test in headless way for IKVM.AWT.WinForm?
.NET6-Window version
of IKVM.AWT.WinForm

You should probably not bother Jeroen. He is unlikely to answer.
Why in ikvm-revived these are not included in Ikvm.Runtime.JNI?
The native libraries encompassed two parts originally: the JNIEnv bridge, and a number of one-off functions used in various parts of IKVM (mmap, few other minor things). The mmap stuff was removed (by me). All that remains is the JNIEnv bridge. And that continues to live in the ikvm-native library.
Can someone show me how to run and test in headless way for IKVM.AWT.WinForm?
What tests? What are you talking about?
@wasabii
What u mean by this? Thanks

Yes, but what tests?
Java has a headless mode. Look it up.
Will leave this issue around to discuss eventual AWT support.
Please do not close this issue, as it represents actual future work that should be accomplished.
This will be done in a couple of weeks https://github.com/ikvmnet/ikvm/issues/381#issuecomment-2065922797
Other reference
https://github.com/DjArt/IKVM.AWT.WinForms/issues/1
https://github.com/ikvmnet/ikvm/pull/528
@lytico @DjArt I downloaded the nuget from the awt action artifact. Then I simply run this code
Next release with AWT
- 8u152-b08 (GA), October 17th 2017
- 8u192-b08 (GA), October 16th 2018
- 8u275-b01 (GA), November 5th 2020 <= targeting
- 8u302-b08 (GA), July 20th 2021
https://wiki.openjdk.org/display/jdk8u
AWT support merged into develop branch.
@wasabii
Using the latest 8.9.0-pre.1 https://www.nuget.org/packages/IKVM/8.9.0-pre.1 Strange font remain.
using System.Diagnostics;
using java.awt;
namespace IKVM.ConsoleApp
{
public static class Program
{
public static void Main(string[] args)
{
while (!Debugger.IsAttached)
System.Threading.Thread.Sleep(100);
AWTExample1.Foo();
[email protected]("hi");
System.Console.ReadLine();
}
public class AWTExample1 : Frame
{
AWTExample1()
{
var t = new TextField("THIS IS TEXT");
t.setBounds(30, 30, 80, 30);
add(t);
var b = new Button("1234");
b.setLabel("1234");
b.setBounds(30, 100, 80, 30);
add(b);
var b2 = new Button("1234");
b2.setLabel("1234");
b2.setBounds(30, 200, 80, 30);
add(b2);
setSize(300, 300);
setTitle("This is our basic AWT example");
setLayout(null);
setVisible(true);
}
public static void Foo()
{
new AWTExample1();
}
}
}
}