You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the "Graph Visualization" tutorial of the documentation it is said that in order to include the viewer into a user-defined JPanel you have to use more or less the following code:
This unfortunately doesn't work since the View class does not extend JPanel.
The solution I found is instead to use the SwingViewer and the ViewPanel classes, the latter which in fact extends JPanel.
simdeistud
changed the title
Documentation is wrong about integrating the viewer into a JPanel
Documentation is wrong about integrating the viewer into a JPanel + proposed Fix
Dec 8, 2023
In the "Graph Visualization" tutorial of the documentation it is said that in order to include the viewer into a user-defined JPanel you have to use more or less the following code:
This unfortunately doesn't work since the View class does not extend JPanel.
The solution I found is instead to use the SwingViewer and the ViewPanel classes, the latter which in fact extends JPanel.
This code actually works and correctly embeds a viewer into an external JPanel.
I don't know why the tutorial is wrong since it's supposed to be updated to the 2.0 version of this library.
The text was updated successfully, but these errors were encountered: