/** Returns the main panel shown on this dialog. */
public GraphPreviewPanel getContent() {
if (this.contentPanel == null) {
this.contentPanel = new GraphPreviewPanel(getJGraph());
this.contentPanel.initialise();
this.contentPanel.setEnabled(true);
// make any dialog in which this panel is embedded resizable
// taken from https://blogs.oracle.com/scblog/entry/tip_making_joptionpane_dialog_resizable
this.contentPanel.addHierarchyListener(new HierarchyListener() {
@Override
public void hierarchyChanged(HierarchyEvent e) {
Window window =
SwingUtilities.getWindowAncestor(GraphPreviewDialog.this.contentPanel);
if (window instanceof Dialog) {
Dialog dialog = (Dialog) window;
if (!dialog.isResizable()) {
dialog.setResizable(true);
}
}
}
});
}
return this.contentPanel;
}
GraphPreviewDialog.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:JavaGraph
作者:
评论列表
文章目录