/** * Returns a JMenu object for use in the JMenuBar. * * @return JMenu */ private JMenu getAboutMenu() { JMenu aboutMenu = new JMenu("Om"); aboutMenu.setMnemonic('o'); JMenuItem tipsItem = new JMenuItem("Dagens tips"); tipsItem.setMnemonic('d'); tipsItem.addActionListener(evt -> dailyTips()); JMenuItem aboutItem = new JMenuItem("Om Fargestiften"); aboutItem.setMnemonic('o'); aboutItem.addActionListener( evt -> { AboutDialog about = new AboutDialog(); internalFrameSize = about.getSize(); about.setLocation( (desktopSize.width - internalFrameSize.width) / 2, (desktopSize.height - internalFrameSize.height) / 2); about.setVisible(true); jDesktopPane.add(about, JLayeredPane.MODAL_LAYER); try { about.setSelected(true); } catch (PropertyVetoException e) { e.printStackTrace(); } }); aboutMenu.add(tipsItem); aboutMenu.add(aboutItem); return aboutMenu; }
private void aboutMenuItemActionPerformed( java.awt.event.ActionEvent evt) // GEN-FIRST:event_aboutMenuItemActionPerformed { // GEN-HEADEREND:event_aboutMenuItemActionPerformed AboutDialog ad = new AboutDialog(this, true); ad.setLocation(512, 360); ad.setVisible(true); } // GEN-LAST:event_aboutMenuItemActionPerformed
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.mainmenu_about: AboutDialog aboutDialog = new AboutDialog(this); aboutDialog.show(); break; } return super.onOptionsItemSelected(item); }
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_about: AboutDialog dialog = new AboutDialog(this); dialog.show(); return true; case R.id.menu_app_settings: AppSettingsActivity.Launch(this); return true; } return super.onOptionsItemSelected(item); }
public void about() { GWT.log("about()"); if (aboutDialog == null) { aboutDialog = new AboutDialog(); } aboutDialog.show(); }
/* Handles item selections */ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.MenuItemShowHelp: String targetURL = getString(R.string.AboutZipSignerDocUrl); Intent wsi = new Intent(Intent.ACTION_VIEW, Uri.parse(targetURL)); startActivity(wsi); return true; case R.id.MenuItemDonate: String donateURL = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=24Y8S9UH5ETRU"; Intent di = new Intent(Intent.ACTION_VIEW, Uri.parse(donateURL)); startActivity(di); return true; case R.id.MenuItemManageKeys: // Launch the ZipSignerActivity to perform the signature operation. Intent mki = new Intent("kellinwood.zipsigner.action.MANAGE_KEYS"); // Activity is started and the result is returned via a call to onActivityResult(), below. startActivityForResult(mki, REQUEST_CODE_MANAGE_KEYS); return true; case R.id.MenuItemAbout: AboutDialog.show(this); return true; } return false; }
public void onPrepareDialog(int id, Dialog dialog) { switch (id - mFirstDialogId) { case OFFSET_ABOUT: AboutDialog.onPrepareDialog(mActivity, dialog); break; } }
/** Displays the about dialog */ public void showAboutDialog() { if (aboutDialog == null) { aboutDialog = new AboutDialog(frame); } else { aboutDialog.setVisible(true); } }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.about) { AboutDialog.show(this); return true; } return super.onOptionsItemSelected(item); }
// code which handles the action for each menu item public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: { Intent preferences_intent = new Intent(); preferences_intent.setComponent( new ComponentName(download_photos.this, preferences.class)); preferences_intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplicationContext().startActivity(preferences_intent); return true; } case R.id.logout: { try { download_photos.this.facebook.logout(getApplicationContext()); } catch (IOException e) { e.printStackTrace(); } mPrefs = getSharedPreferences("COMMON", MODE_PRIVATE); SharedPreferences.Editor editor = mPrefs.edit(); editor.putString("access_token", null); editor.putLong("access_expires", 0); editor.putBoolean("logout", true); editor.commit(); finish(); return true; } case R.id.about: { // shows our customized about dialog AboutDialog about = new AboutDialog(this); about.show(); return true; } // lets deal with default case default: return super.onOptionsItemSelected(item); } }
public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id - mFirstMenuId) { case OFFSET_UPDATE: mActivity.showDialog(mFirstDialogId + OFFSET_UPDATE); return true; case OFFSET_ABOUT: AboutDialog.showDialogOrStartActivity(mActivity, mFirstDialogId + OFFSET_ABOUT); return true; } return false; }
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.LogoutMenuItem: VApplication.logout(this); return true; case R.id.AboutMenuItem: AboutDialog.makeDialog(this).show(); return true; case R.id.ExitMenuItem: // VApplication.stopService(this); VApplication.exit(); return true; } return super.onOptionsItemSelected(item); }
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { setProgressBarIndeterminateVisibility(true); HomeGridAdapter.Item item = (HomeGridAdapter.Item) HomeGridActivity.this.adapter.getItem(position); Intent intent = item.getIntent(); changeTitle(item.getTitle()); if (item.getType() == HomeGridAdapter.ItemType.HELP) { AboutDialog.makeDialog(this).show(); backToHome(); } else if (intent != null) { startActivity(intent); } else { Toast.makeText(this, "Not implemented", Toast.LENGTH_SHORT).show(); backToHome(); } }
private void showAbout() { AboutDialog dialog = new AboutDialog(frame); dialog.setVisible(true); }
/** Shows the about dialog. */ protected void showAbout() { AboutDialog dialog = new AboutDialog(this, browser.getBuildInfo()); dialog.setVisible(true); }
public void actionPerformed(ActionEvent e) { AboutDialog ad = new AboutDialog((DemoApp) SwingUtilities.getWindowAncestor(demo)); ad.setLocationRelativeTo(demo); ad.setVisible(true); }