public void show(boolean forceShow) { Properties tipProperties = Tips.get().getTips(); TipOfTheDayModel loadedTips = TipLoader.load(tipProperties); final boolean settingsShowDialog = Settings.get().isShowTipsAtStartup(); JXTipOfTheDay tipOfTheDay = new JXTipOfTheDay(loadedTips); Random generator = new Random(); int i = generator.nextInt(loadedTips.getTipCount()); tipOfTheDay.setCurrentTip(i); tipOfTheDay.showDialog( Application.get(), new JXTipOfTheDay.ShowOnStartupChoice() { @Override public void setShowingOnStartup(boolean showOnStartup) { Settings.get().setShowTipsAtStartup(showOnStartup); } @Override public boolean isShowingOnStartup() { return settingsShowDialog && !Settings.get().isProxyEnabled(); } }, forceShow); }
public void run() { if (infoLabel.getText().equals("")) { tipsLabel.setText(Tips.get().getRandomTip()); } }