Firstly, I’m not sure if this is the right place for generic questions about the Java target. Sorry if this is inconvenient.
I’m trying to build a simple Swing GUI project using Elements, this is the code (converted to Swift from a Java tutorial):
import javax.swing.JFrame
import javax.swing.JButton
let f = JFrame()
let b = JButton("click")
b.setBounds(130, 100, 100, 40)
f.add(b)
f.setSize(400, 500)
f.setLayout(nil)
f.setVisible(true)
The compile fails with this error:
E: Unknown namespace "javax.swing.JFrame" in uses list [/Volumes/Data/dev/elements/swingtest/Program.swift (1)]
E: Unknown namespace "javax.swing.JButton" in uses list [/Volumes/Data/dev/elements/swingtest/Program.swift (2)]
E: Unknown identifier "JFrame" [/Volumes/Data/dev/elements/swingtest/Program.swift (4)]
E: Unknown identifier "JButton" [/Volumes/Data/dev/elements/swingtest/Program.swift (6)]
Project 'swingtest' failed to build.
Solution 'swingtest' failed to build project 'swingtest'.
This seems strange, because I’ve tested this with standard Java in IntelliJ and it works fine, using the same JDK. Why is it different in Elements?