1

I have this STP file that contains the undirected weighted graph information, this is a sample.

33D32945 STP File, STP Format Version 1.0

SECTION Comment
Name    "lin01"
Creator "C. Lin"
END

SECTION Graph
Nodes 53
Edges 80
E 1 32 46
E 1 25 26
E 2 51 10
E 2 32 74
E 2 11 70
E 42 50 2
E 43 53 42
E 47 53 46
END

SECTION Terminals
Terminals 4
T 1  
T 9
T 40
T 47
END

SECTION Coordinates
DD 1 420 128
DD 2 346 174
DD 3 0 0
DD 50 492 102
DD 51 346 184
DD 52 0 110
DD 53 346 102
END

EOF

I did not find anything about graphs in Netbeans so how to represent this undirected weighted graph in a JFrame. Could anyone provide me with examples and other resources?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
RamiB
  • 23
  • 1
  • 3
  • 1
    You draw on a drawing `JPanel`, not a `JFrame`. Oracle has a helpful tutorial, [Creating a GUI With Swing](https://docs.oracle.com/javase/tutorial/uiswing/index.html). Skip the Learning Swing with the NetBeans IDE section. Pay close attention to the [Concurrency in Swing](https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html) and the [Laying Out Components Within a Container](https://docs.oracle.com/javase/tutorial/uiswing/layout/index.html) sections. – Gilbert Le Blanc Jan 08 '22 at 20:16
  • You can also look into Netbeans Visual library. https://netbeans.apache.org/tutorials/60/nbm-visual_library.html – Cheng Thao Jan 09 '22 at 00:30

0 Answers0