Cannot invoke "org.oscim.backend.CanvasAdapter.newCanvasImpl()" because "org.oscim.backend.CanvasAdapter.g" is null #871
Answered
by
devemux86
codewriter3000
asked this question in
Q&A
-
I'm getting this error when debugging:
Here is my maven: <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>Magellan</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.mapsforge</groupId>
<artifactId>vtm-desktop</artifactId>
<version>0.16.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
</project> And this is my code: import org.oscim.awt.AwtGraphics;
import org.oscim.backend.canvas.Canvas;
import javax.swing.*;
import java.awt.*;
public class UserInterface {
public UserInterface(){ showUI(); }
private void showUI(){
JFrame jFrame = new JFrame();
jFrame.setSize(500, 500);
Canvas canvas = AwtGraphics.newCanvas();
Container container = jFrame.getContentPane();
container.setLayout(new BorderLayout());
container.add((Component) canvas);
jFrame.setVisible(true);
jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
public static void main(String[] args){ new UserInterface(); }
} |
Beta Was this translation helpful? Give feedback.
Answered by
devemux86
Aug 15, 2021
Replies: 1 comment 2 replies
-
See the vtm-playground examples for how to initialize and use VTM on desktop. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
devemux86
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the vtm-playground examples for how to initialize and use VTM on desktop.