本文整理汇总了Java中net.jini.lookup.entry.UIDescriptor.getUIFactory方法的典型用法代码示例。如果您正苦于以下问题:Java UIDescriptor.getUIFactory方法的具体用法?Java UIDescriptor.getUIFactory怎么用?Java UIDescriptor.getUIFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.jini.lookup.entry.UIDescriptor
的用法示例。
在下文中一共展示了UIDescriptor.getUIFactory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import net.jini.lookup.entry.UIDescriptor; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent anEvent) {
UIDescriptor uiDescriptor = getSelectedUIDescriptor();
if (uiDescriptor == null) {
return;
}
try {
JFrameFactory uiFactory = (JFrameFactory)
uiDescriptor.getUIFactory(Thread.currentThread().getContextClassLoader());
JFrame frame = uiFactory.getJFrame(serviceItem);
frame.validate();
frame.setVisible(true);
}
catch (Exception e) {
e.printStackTrace();
return;
}
}
示例2: actionPerformed
import net.jini.lookup.entry.UIDescriptor; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent ev) {
String command = ev.getActionCommand();
if (command.equals("showInfo")) {
Class[] infs = getInterfaces(item.service.getClass());
String[] msg = new String[3 + infs.length];
msg[0] = "ServiceID: " + item.serviceID;
msg[1] = ("Service Instance: "
+ item.service.getClass().getName());
if (infs.length == 1) {
msg[2] = "Implemented Interface:";
} else {
msg[2] = "Implemented Interfaces:";
}
for (int i = 0; i < infs.length; i++) {
msg[3 + i] = infs[i].getName();
}
JOptionPane.showMessageDialog(Browser.this,
msg,
"ServiceItem Information",
JOptionPane.INFORMATION_MESSAGE);
} else if (command.equals("browseService")) {
new ServiceBrowser(item, lookup,
Browser.this).setVisible(true);
} else if (command.equals("adminService")) {
new ServiceEditor(item, listItem.getAdmin(),
lookup, Browser.this).setVisible(true);
} else if (command.equals("browseEntry")) {
// Not supported at the present time.
} else if (command.equals("showUI")) {
UIDescriptor uiDescriptor = getSelectedUIDescriptor();
if (uiDescriptor == null) {
return;
}
try {
JFrameFactory uiFactory = (JFrameFactory) uiDescriptor.getUIFactory(
Thread.currentThread().getContextClassLoader());
JFrame frame = uiFactory.getJFrame(item);
frame.validate();
frame.setVisible(true);
} catch (Exception e) {
logger.log(Level.INFO, "show ui failed", e);
JOptionPane.showMessageDialog(Browser.this,
e.getMessage(),
e.getClass().getName(),
JOptionPane.WARNING_MESSAGE);
return;
}
}
}