Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Über Button chm Datei öffnen

Empfohlene Antworten

Veröffentlicht

hallo zusammen,

ich habe folgendes problem:

ich habe einen button, wenn ich auf diesen klicke, möchte ich, dass sich die chm Datei öffnet, die ich erstellt habe. ich habe aber leider gar keine ahnung wie man mit java eine externe Datei öffnet.

kann mir jmd. helfen.

Danke im vorraus

Gruß Julie

Diese Dateien musst du mit dem Programm "hh.exe" öffnen. Naja, obwohl ich nicht der Freund von solchen Sachen bin, verrate ich dir trotzdem wie das geht. ;)


Runtime.getRuntime().exec("C:/WINNT/hh.exe " + dateiname);

Grüße, Peet

  • Autor

Also ich hab das jetzt so gemacht wie du gesagt hast aber das funktioniert leider nicht ich krieg die meldung Hilfe cannot be resolved.

Die Datei Hilfe.chm liegt im gleichen Ordner wie die klasse. :confused:


buttonHilfe = new JButton();

buttonHilfe.addActionListener(new ActionListener()                      

{

  public void actionPerformed(ActionEvent e)

  {

    Runtime.getRuntime().exec("C:/WINNT/hh.exe " + Hilfe.chm);

  }

});


buttonHilfe = new JButton();

buttonHilfe.addActionListener(new ActionListener()                      

{

  public void actionPerformed(ActionEvent e)

  {

    String dateiname = "Hilfe.chm";

    Runtime.getRuntime().exec("C:/WINNT/hh.exe " + dateiname);

  }

});

Gruß Jaraz

Du musst darauf achten WO diese "hh.exe" liegt und als Dateiname gibst du am besten den kompletten, absoluten Pfad zu deiner chm-Datei an.

So wie Jaraz es gemacht hat bloß mit absolutem Pfad. ;)

[edit] verdammt, zu spät! :beagolisc [/edit]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.