本文整理汇总了Java中com.sun.swingset3.demos.DemoUtilities类的典型用法代码示例。如果您正苦于以下问题:Java DemoUtilities类的具体用法?Java DemoUtilities怎么用?Java DemoUtilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DemoUtilities类属于com.sun.swingset3.demos包,在下文中一共展示了DemoUtilities类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hyperlinkUpdate
import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent event) {
JEditorPane descriptionPane = (JEditorPane) event.getSource();
HyperlinkEvent.EventType type = event.getEventType();
if (type == HyperlinkEvent.EventType.ACTIVATED) {
try {
DemoUtilities.browse(event.getURL().toURI());
} catch (Exception e) {
e.printStackTrace();
System.err.println(e);
}
} else if (type == HyperlinkEvent.EventType.ENTERED) {
defaultCursor = descriptionPane.getCursor();
descriptionPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
} else if (type == HyperlinkEvent.EventType.EXITED) {
descriptionPane.setCursor(defaultCursor);
}
}
示例2: actionPerformed
import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
int row = ((Integer) event.getSource()).intValue();
OscarCandidate candidate = oscarModel.getCandidate(oscarTable.convertRowIndexToModel(row));
try {
URI imdbURI = candidate.getIMDBMovieURI();
if (imdbURI == null) {
String imdbString = IMDBLink.getMovieURIString(candidate.getMovieTitle(),
candidate.getYear());
if (imdbString != null) {
imdbURI = new URI(imdbString);
candidate.setIMDBMovieURI(imdbURI);
}
}
if (imdbURI != null) {
DemoUtilities.browse(imdbURI);
} else {
showMessage("IMDB Link",
getString("TableDemo.imdbLinkNotFound",
"Unable to locate IMDB URL for") + "\n" +
candidate.getMovieTitle());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例3: actionPerformed
import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void actionPerformed(ActionEvent event) {
int row = ((Integer) event.getSource()).intValue();
OscarCandidate candidate = oscarModel.getCandidate(oscarTable
.convertRowIndexToModel(row));
try {
URI imdbURI = candidate.getIMDBMovieURI();
if (imdbURI == null) {
String imdbString = IMDBLink.getMovieURIString(
candidate.getMovieTitle(), candidate.getYear());
if (imdbString != null) {
imdbURI = new URI(imdbString);
candidate.setIMDBMovieURI(imdbURI);
}
}
if (imdbURI != null) {
DemoUtilities.browse(imdbURI);
} else {
showMessage(
"IMDB Link",
getString("TableDemo.imdbLinkNotFound",
"Unable to locate IMDB URL for")
+ "\n"
+ candidate.getMovieTitle());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例4: start
import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void start() {
DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
showDialog();
}
示例5: start
import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void start() {
DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);
showWindow();
}
示例6: start
import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void start() {
DemoUtilities.setToplevelLocation(frame, frameSpaceholder, SwingConstants.CENTER);
showFrame();
}