Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWT #144

Closed
GeorgeS2019 opened this issue Sep 10, 2022 · 20 comments
Closed

AWT #144

GeorgeS2019 opened this issue Sep 10, 2022 · 20 comments

Comments

@GeorgeS2019
Copy link

GeorgeS2019 commented Sep 10, 2022

Not relevant

@wasabii
Copy link
Contributor

wasabii commented Sep 10, 2022

AWT is presently unsupported.

@GeorgeS2019 GeorgeS2019 changed the title CreateGraphics not working IKVM.AWT.WinForm currently not supported: CreateGraphics not working Sep 10, 2022
@wasabii
Copy link
Contributor

wasabii commented Sep 10, 2022

It's not supported on Windows either.

@wasabii
Copy link
Contributor

wasabii commented Sep 10, 2022

AWT is a windowing toolkit. I can't quite figure out what you're suggesting.

@wasabii
Copy link
Contributor

wasabii commented Sep 10, 2022

Headless mode might work.

@wasabii wasabii changed the title IKVM.AWT.WinForm currently not supported: CreateGraphics not working IKVM.AWT.WinForm Sep 12, 2022
@wasabii
Copy link
Contributor

wasabii commented Sep 12, 2022

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.

@wasabii wasabii changed the title IKVM.AWT.WinForm AWT Sep 12, 2022
@wasabii
Copy link
Contributor

wasabii commented Sep 15, 2022

I don't know what that error is in reference to. You're going to have to be more specific.

@wasabii
Copy link
Contributor

wasabii commented Sep 15, 2022

AWT is not supported.......

@wasabii
Copy link
Contributor

wasabii commented Sep 16, 2022

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.

@wasabii
Copy link
Contributor

wasabii commented Sep 16, 2022

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
Copy link
Contributor

wasabii commented Sep 27, 2022

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.

@wasabii
Copy link
Contributor

wasabii commented Sep 27, 2022

Can someone show me how to run and test in headless way for IKVM.AWT.WinForm?

What tests? What are you talking about?

@wasabii
Copy link
Contributor

wasabii commented Sep 27, 2022

Yes, but what tests?

@wasabii
Copy link
Contributor

wasabii commented Sep 27, 2022

Java has a headless mode. Look it up.

@wasabii
Copy link
Contributor

wasabii commented Apr 22, 2023

Will leave this issue around to discuss eventual AWT support.

@wasabii wasabii reopened this Apr 22, 2023
@GeorgeS2019 GeorgeS2019 changed the title AWT AWT - not relevant Apr 22, 2023
@wasabii
Copy link
Contributor

wasabii commented Apr 22, 2023

Please do not close this issue, as it represents actual future work that should be accomplished.

@wasabii wasabii reopened this Apr 22, 2023
@wasabii wasabii changed the title AWT - not relevant AWT Apr 22, 2023
@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Apr 19, 2024

This will be done in a couple of weeks
#381 (comment)

Other reference

DjArt/IKVM.AWT.WinForms#1

@GeorgeS2019
Copy link
Author

#528

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented May 26, 2024

@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

image

https://wiki.openjdk.org/display/jdk8u

@wasabii
Copy link
Contributor

wasabii commented May 26, 2024

AWT support merged into develop branch.

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Jul 7, 2024

@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();

            java.lang.System.@out.println("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();
            }

        }

    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants