本文整理汇总了Java中org.jdesktop.application.Application.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Application.getInstance方法的具体用法?Java Application.getInstance怎么用?Java Application.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.application.Application
的用法示例。
在下文中一共展示了Application.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canExit
import org.jdesktop.application.Application; //导入方法依赖的package包/类
@Override
public boolean canExit (EventObject eo)
{
// Check whether the repository has been saved (or user has declined)
if (isModified()) {
SingleFrameApplication appli = (SingleFrameApplication) Application.getInstance();
int answer = JOptionPane.showConfirmDialog(
appli.getMainFrame(),
"Save " + SampleRepository.this + "?");
if (answer == JOptionPane.YES_OPTION) {
storeRepository();
return true; // Here user has saved the repository
}
// True: user specifically chooses NOT to save the script
// False: user says Oops!, cancelling the current close request
return answer == JOptionPane.NO_OPTION;
}
return true;
}
示例2: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
public static MainApp getApplication()
/* 18: */ {
/* 19:35 */ return (MainApp)Application.getInstance(MainApp.class);
/* 20: */ }
示例3: showCalendarFrame
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
*
*/
public void showCalendarFrame() {
calendarFrame = new JXFrame("Calendar 2010");
calendarFrame.setName("calendar2010");
calendarFrame.setDefaultCloseOperation(JXFrame.DO_NOTHING_ON_CLOSE);
WindowListener l = new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
calendarFrame.removeWindowListener(this);
hideCalendarFrame();
}
};
calendarFrame.addWindowListener(l);
JXPanel calendar = new JXPanel();
calendar.setBackground(Color.WHITE);
Painter<?> painter = createBackgroundPainter();
calendar.setBackgroundPainter(painter);
JXMonthView monthView = new JXMonthView();
Calendar cal = monthView.getCalendar();
cal.set(Calendar.YEAR, 2010);
cal.set(Calendar.MONTH, Calendar.JANUARY);
monthView.setFirstDisplayedDay(cal.getTime());
monthView.setOpaque(false);
monthView.setPreferredColumnCount(3);
monthView.setPreferredRowCount(4);
// old style: set visual property with JXMonthView api
monthView.setDayForeground(Calendar.SUNDAY, Color.MAGENTA);
// <snip> Custom CalendarRenderingHandler
// new style: install a custom renderingHandler
// (as client property, because no public api support yet)
// which allows to add Highlighters
monthView.putClientProperty(DemoMonthViewUI.RENDERING_HANDLER_KEY,
createRenderingHandler());
// </snip>
DemoUtils.setSnippet("Custom CalendarRenderingHandler", monthView);
calendar.add(monthView);
calendarFrame.add(calendar);
Application application = Application.getInstance(Application.class);
if (application instanceof SingleFrameApplication) {
((SingleFrameApplication) application).show(calendarFrame);
} else {
calendarFrame.pack();
calendarFrame.setLocationRelativeTo(this);
calendarFrame.setVisible(true);
}
}
示例4: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/** A convenient static getter for the application instance. */
public static NeuGenApp getApplication() {
return Application.getInstance(NeuGenApp.class);
}
示例5: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
public static WolfIDE getApplication()
{
return Application.getInstance(WolfIDE.class);
}
示例6: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of SampleDesktopApplication
*/
public static SampleDesktopApplication getApplication() {
return Application.getInstance(SampleDesktopApplication.class);
}
示例7: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of SumoPlatform
*/
public static SumoPlatform getApplication() {
return Application.getInstance(SumoPlatform.class);
}
示例8: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of ConverterApp
*/
public static ConverterApp getApplication() {
return Application.getInstance(ConverterApp.class);
}
示例9: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* Report the single instance of this GUI SAF application.
*
* @return the SingleFrameApplication instance
*/
public static SingleFrameApplication getApplication ()
{
return (SingleFrameApplication) Application.getInstance();
}
示例10: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
*
* @return the instance of CanRegClientApp
*/
public static CanRegClientApp getApplication() {
return Application.getInstance(CanRegClientApp.class);
}
示例11: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of MainApp
*/
public static MainApp getApplication() {
return Application.getInstance(MainApp.class);
}
示例12: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of RattingAdvisorApp
*/
public static RattingAdvisor getApplication() {
return Application.getInstance(RattingAdvisor.class);
}
示例13: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of EmailApp
*/
public static EmailApp getApplication() {
return Application.getInstance(EmailApp.class);
}
示例14: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of PictoWordApp
*/
public static AraWordApp getApplication() {
return Application.getInstance(AraWordApp.class);
}
示例15: getApplication
import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
* A convenient static getter for the application instance.
* @return the instance of CacheModeler_SingleVersionApp
*/
public static CacheModeler_MultyprocessorVersionApp getApplication() {
return Application.getInstance(CacheModeler_MultyprocessorVersionApp.class);
}