I am now desperate please help!!!!
This printing stuff is doing my head in please help
Here is my code I don't seem to be able to identify a printer at all. Can someone shed some light on this for me.!!
import java.io.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import javax.print.event.*;
import javax.print.ServiceUI.*;
public class PrintFile {
// public static void main(String args[]) {
// PrintFile pf = new PrintFile();
// System.out.println("Inside sorting printing document");
public void PrintFile() {
FileInputStream fis = null;
try
fis = new FileInputStream("logfile.txt");
catch(FileNotFoundException ffne)
if (fis == null)
return;
System.out.println("Inside sorting printing document");
DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
Doc doc = new SimpleDoc(fis, flavor, null);
PrintRequestAttributeSet aset =
new HashPrintRequestAttributeSet();
// aset.add(MediaSizeName.ISO_A4);
aset.add(new Copies(1));
// aset.add(Sides.ONE_SIDED);
// aset.add(Finishings.STAPLE);
/* locate a print service that can handle it */
PrintService[] pservices =
PrintServiceLookup.lookupPrintServices(flavor,aset);
if (pservices.length > 0) {
System.out.println("selected printer " + pservices[0].getName());
/* create a print job for the chosen service */
DocPrintJob pj = pservices[0].createPrintJob();
try {
/* print the doc as specified */
pj.print(doc, aset);
fis.close();
} catch (PrintException e) {
System.err.println(e);
catch (IOException ioe)
else
System.out.println("Something not right here");
}
i'm not sure why your code don't work but i see you have lots of //
anything behind // is a comment right ?
is lines 10-14 supost to be comments ?
ant
Similar Messages
-
My mom put my ipod 5th gen in the house somewhere and it was turned off. It is connected to the internet in the house. How do i turn it on with the Findmyiphone or something else? It was an expensive gift and we can't find it now! Please help! How do i turn it on without finding it because she can't remember where it was.
That is so dumb...Apple is the best and most techinological company IN THE WORLD and they don't have the time to invent something like that? HUH? All they are worried about is making the "Worlds best Phone" and they can't take the time out to help their users or anybody that has their products. All they have is "Find mt Iphone" Well they should step up and do something else to help people like me out. Find a way to turn it on and you can find it or find a way to turn it on remotely.
Thank you for your replys -
I bought my ipad 2 from an acquintance. I updated my software to iOS7 and after that was when all this started. I got locked out because I was not using the right password. After that, I restored my ipad. After learning that the previous owner had to remove the ipad from their account, I contacted her and she did remove it. Now, when I get to the Activate screen, it will not take my ID and password. I've done all the steps necessary but can not get past this. I've read so many threads and other articles on restoring and having the previous owner remove it, I've done all of that, but what do I do now? Please help! Thank you.
The previous owner/user should have done this.
What to do before selling or giving away your iPhone, iPad, or iPod touch
http://support.apple.com/kb/HT5661
Find My iPhone Activation Lock: Removing a device from a previous owner’s account
http://support.apple.com/kb/ts4515
Buying or Selling a Used iPhone or iPad Running iOS 7? Read This First!
http://www.makeuseof.com/tag/buying-or-selling-a-used-iphone-running-ios-7-read- this-first/
Cheers, Tom -
ok here goes nothing i have a late 2009 iMac 27 11.1 intel bought it refurbished and they installed mountain lion 10.8.4 on delivery w/o disks i think ran lion orig. idk & its been all problems 10.8.5 M.L so tried Maverick 10.9 now worse please help me.....i still have backups of software for mountain lion 10.8 however i need to throw everything on a usb toshiba 1TB external storage for backup, plus from what ive read being i needed to try to go back and update the efi and frimware for my original model but when i found the right one it wont accept it.....and now i just tried to reinstall my mountain lion probably shoud have left in the cloud til i got backed up ...which i now needed to move my previous backed up stuff off the drive to reformat it properly as i read it being toshiba needs to be guid hard drive mac im relatively new to the whole mac thing and im just as ****** off as i was with PC ....lol i just wanna record music and have a steady workflow i do have a new 4s iphone and cloud storage but i believe my computers hacked or got malware or just ****** from incompatiable software ......and keychains not working for admin either PLEASE tell ,me what to do thx .....i will be so grateful im good with recording software and stuff bad with computers programing lol HELP me
Hardware Overview:
Model Name: iMac
Model Identifier: iMac11,1
Processor Name: Intel Core i7
Processor Speed: 2.8 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB
Processor Interconnect Speed: 4.8 GT/s
Boot ROM Version: IM111.0034.B02
SMC Version (system): 1.54f36
Message was edited by: lnwko -
Since I've uploaded IOS 7 and can't open PDFs now. Please help.
Since I've uploaded IOS 7 and can't open PDFs now. Please help.
Try #12 and #4 and go through the rest if necessary:
http://helpx.adobe.com/dreamweaver/kb/troubleshoot-javascript-errors-dreamweaver-cs4.html -
One particular song wont play and was playing earlier and now skips please help
one particular song wont play that could play earlier and now skips please help
i would delete and re download it from itunes if you purchased it form them
-
I bought an iphone 5 from apple store in Geneva to use in Turkey. But it is sim-locked. What can I do now. Please help urgently.
Return it to the store where you purchased & get your money back. Either that, or call the store. No one here can help you, as there is no one from Apple here.
-
Hi, It's been a week now since im having this problem with my iPod touch 4thgen 8GB. it says it needs to be restored but when i do so it gives me an error which says " the iPod software update server could not be contacted ". I've tried restoring it a hundred times and each time this is what it says. under it is written " make sure your network settings are correct and your network connection is active or try again later ". what does that mean? that what am I suppose to do now? please help.
Try:
- Powering off and then back on your router.
- iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
- Change the DNS to either Google's or Open DNS servers
Public DNS — Google Developers
OpenDNS IP Addresses
- Try on another computer/network
- Wait if it is an Apple problem -
My itouch just crashed unexpectantly. I can't open the itouch up. Also,nothing would show up even when i plug it in into the computer... What do I do now? please help! Thanks!
Well plug it in again, and then hold the "Lock" and "Home" button at the same time for about 10 seconds. See if that helps.
-
Hi, my apple account is locked. I can't receive the verification email and I forgot the answers to the verification questions. I can't reset my account now. Please help me. Thank you very much.
After two years? No, not likely you are going to get it. Try contacting iTunes support: https://getsupport.apple.com/Issues.action
-
its been 1 day since i reset "erase all contents" my ipad4 but nothing happens, what will i do now?please help me..thanks
Try this - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430http://support.apple.com/kb/ht1430
Cheers, Tom -
Dear Apple, i took 4 videos from my friend's windows 8 pc but all of them shown a error that To see if additional software is available that will enable QuickTime Player to open the movie, click Tell Me More." what should i do now? please help me Apple
If the videos are .wmv files, VLC from VideoLAN will play them and pretty much any other media format.
BTW, we are not Apple; we're just users like yourself. -
this morning my iphone showed up a activation problem then it told me to go to devoloper.apple.com and register for the ios developer program.. it costed me 99 dollars. but i did it.. just a moment ago.. how do i access my iphone now? please help me this is real urgent.
this in my problem too apple say : ur request is pending now and it did not activated yet ! ?
what should i do? -
hello?wish you all success in your work.I used what you bought a 3GS.Factory Reset, and am not turned on.What to do now?please help me?
Safari 4.1.3 for Tiger can be downloaded here:
http://support.apple.com/kb/DL1069 -
Hi. My ex girlfriend used her apple id and icloud to register my iphone. and now i want to sell my phone to someone but i cant reset all the contents and password because i dont know my ex password. we dont have anymore communication right now. please help. thnx
No one here can help you, nor can/will Apple. Unless you can get that info, you won't be able to restore the phone, to sell it, or re-activate it.
You need to somehow get back in touch with your girlfriend & obtain this info, or all you'll own is a paperweight.
Maybe you are looking for
-
I just downloaded Creative Suite 6 Design and Web Premium for Windows and the Adobe Acrobat component isn't working. It doesn't open by itself or to open a PDF. InDesign and Illustrator are working fine, so I'm not sure why Acrobat specifically isn't
-
SetInterval and XML Load Problem
Hello, I 'm having the simple problem of making sure the XML is loaded before beginning the Interval sequence. Therefore it is missing some of the XML data when loading. See example: http://alt.coxnewsweb.com/statesman/img/advertising/_jacob/Site1/pr
-
Call HEADER value into ITEM level in mapping
HI, my structure is as below: H I I I P H I I P P H I I I I I P I have created a sequence in DB and retriving the value from DB using lookup for the header level(H) for feild ID.by using the code: //write your code here //write your code here S
-
My Mac Pro boots to Mac OS X Utilities, the Lion installer. I have my internal drive selected as startup disc, but can't get it to boot to that.
-
HT5625 how do i create apple id with my iphone 5s
How can i transfer my contact from blackberry to my iphone 5s?