You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

stefan

Beginner

  • "stefan" started this thread

Posts: 2

Date of registration: Oct 5th 2010

  • Send private message

1

Tuesday, October 5th 2010, 2:10pm

Drucken, wie ?

Hi Leute !

Wer kann einem Dummy, also mir, erklären wie einen einfachen Text drucken (Papier) kann. Mit dem Hinweis auf Java komme ich nicht ganz klar (irgendwie einen inneren Widerstand, ka)

Gruß

Stefan



May, the 4. be with you.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Tuesday, October 5th 2010, 3:59pm

Dieses Beispiel zeigt, wie man eine existierende Textdatei ausdrucken kann.
Außerdem zeigt es den Umgang mit dem Desktop-Objekt.
Nebenbei erfährt man noch, wie Java-Klassen eingebunden werden.

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Option Explicit

Import java#awt#Desktop 

Public Sub Command1_Click()
   Dim desk As Desktop 
   Dim fileToPrint As java#io#File 
   
   On Error Goto ErrHandler
   
   If Desktop.isDesktopSupported() Then
     Debug.Print "Desktop-Klasse wird unterstützt"
     desk = Desktop.getDesktop()
     Debug.Print "Der Browser kann geöffnet werden: " _
                 & desk.isSupported(Desktop$Action.BROWSE)
     Debug.Print "Eine Datei kann editiert werden: " _
        	        & desk.isSupported(Desktop$Action.EDIT)
     Debug.Print "Das Mail-Programm kann geöffnet werden: " _
                 & desk.isSupported(Desktop$Action.MAIL)
     Debug.Print "Eine Datei kann geöffnet werden: " _
                 & desk.isSupported(Desktop$Action.OPEN)
     Debug.Print "Eine Datei kann gedruckt werden: " _
                 & desk.isSupported(Desktop$Action.PRINT)
                 
      fileToPrint = New File("C:\tmp\Neu Textdokument.txt")
      desk.print(fileToPrint)
   End If

   Exit Sub
   
ErrHandler:
   Debug.Print Err.getMessage() 
End Sub


Gruß!

A1880

stefan

Beginner

  • "stefan" started this thread

Posts: 2

Date of registration: Oct 5th 2010

  • Send private message

3

Wednesday, October 6th 2010, 8:52am

Danke für den Tipp.

Werde es mal ausprobieren.



Gruß

Stefan

Rate this thread
WoltLab Burning Board