当前位置: 首页>>代码示例>>Java>>正文


Java DemoUtilities类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:20,代码来源:HTMLPanel.java

示例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();
    }
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:28,代码来源:TableDemo.java

示例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();
	}
}
 
开发者ID:JackJiang2011,项目名称:beautyeye,代码行数:31,代码来源:TableDemo.java

示例4: start

import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void start() {
    DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
    showDialog();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:DialogDemo.java

示例5: start

import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void start() {
    DemoUtilities.setToplevelLocation(window, windowSpaceholder, SwingConstants.CENTER);
    showWindow();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:WindowDemo.java

示例6: start

import com.sun.swingset3.demos.DemoUtilities; //导入依赖的package包/类
public void start() {
    DemoUtilities.setToplevelLocation(frame, frameSpaceholder, SwingConstants.CENTER);
    showFrame();
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:5,代码来源:FrameDemo.java


注:本文中的com.sun.swingset3.demos.DemoUtilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。