Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to get a list of available printers on your PC. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Get a list of available printers on your PC. 12-Sep-04
Category
Reporting /Printing
Language
JBuilder All Versions
Views
287
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   import java.awt.*;
3   import java.awt.event.*;
4   import javax.swing.*;
5   import javax.print.*;
6   
7     void jButton2_actionPerformed(ActionEvent e) {
8       DefaultListModel model = new DefaultListModel();
9       JList jList1 = new JList(model);
10      jList1.setToolTipText("");
11      jList1.setBounds(new Rectangle(136, 34, 191, 156));
12      jpnlMain.add(jList1, null); 
13      // list printers on your pc
14       PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);  
15       for (int i=0; i<services.length; i++) {
16           model.add(i, services[i].getName());
17       }
18    }


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC