Who wants some cash? not dukes, cash

Hi,
I'm having a problem with a piece of my code, it's not overly complex but it is non the less stumping me.
The problem is with printing.
If anyone is interested in earning some cash to sort this out for me I'll be happy to talk.
This is my personal code - not works - but I want to get it working.<BR>
If you're interested please post an email address and I'll contact you within minutes.
thanks in advance,
Ed.

Hi,
thanks for that. Don't know how I missed that.
I've added the code you suggested and found that the
PrintException.printStackTrace();
wont compile, it reports an error with println. Should I have imported something for this?
The other part of the error message did print out something rather interesting 'null'
This made me wonder if the problem is that the JVM hasn't instantiated the object that I'm trying to use as my print job object.
I have the following code:
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.swing.JInternalFrame;
import java.util.StringTokenizer;
import javax.swing.JInternalFrame;
import javax.swing.*;
public class printControl extends JInternalFrame implements ActionListener {
public String strClass;
public templatePrint pt;
public finalPrint pf;
then a few lines later :
pt = new templatePrint();
pf = new finalPrint();
pt.addActionListener(this);
pf.addActionListener(this);
Container pane = getContentPane();
pane.setLayout(null);
pane.add(pt);
pane.add(pf);
Insets inset = pane.getInsets();
pt.setBounds(40 + inset.left, 25 + inset.top, 105,40);
pf.setBounds(190 + inset.left, 25 + inset.top, 105,40);
blah blah...
then my action performed code.
public void actionPerformed(ActionEvent e) {
if (e.getSource() instanceof Button) {   
PrinterJob printJob = PrinterJob.getPrinterJob();
if (printJob.printDialog()){
System.out.println(e.getSource().getClass().getName() + " button name");
if (e.getSource().getClass().getName() == "templatePrint"){
printJob.setPrintable((templatePrint) e.getSource());
try { printJob.print(); } catch (Exception PrintException)
System.out.println(PrintException.getMessage()); // + PrintException.printStackTrace();
else
printJob.setPrintable((finalPrint) e.getSource());
try { printJob.print(); } catch (Exception PrintException)
System.out.println(PrintException.getMessage()); // + PrintException.printStackTrace();
Incidentally, this is really my first advenure with printing and I have acquired all of my Java knowledge from a couple of books so far (hence some thicky mistakes).
thanks in advance, it is appreciated.

Similar Messages

  • Who wants some easy Duke Points

    this is copied directly from the Sun's Java Tutorial (see link):
    http://java.sun.com/docs/books/tutorial/essential/io/formatting.html
    is it a typo?
    public class Root2 {
         public static void main(String[] args) {
              int i = 2;
              double r = Math.sqrt(i);
              System.out.format("The square root of %d is %f.%n", i,r);
    the line starting with System.out..... gives me the error:
    The method format(String, Object[]) in the type PrintStream is not applicable for the arguments
    (String, int, double)
    I changed things around and got it to work as follows:
    public class Root2 {
         public static void main(String[] args) {
              int i = 7;
              double r = Math.sqrt(i);
              Number[] n = {Integer.valueOf(i),Double.valueOf(r)};
              System.out.format("The square root of %d is %f.%n", n);
    }

    actually - I started using java 1.6.0_02 and Ialso
    tried 1.5.0_11 - I'm using eclipse 3.2.2Check your compiler settings.as kajbj said, check thecompiler settings, chances are they are set to compile to a compliance level of 1.4 (Window -> Java -> Compiler -> Compiler compliance level)
    ~Tim
    EDIT: Too late again. Damn I am slow this AM :)

  • Who wants some popcorn?

    It's good to have some snack while browsing the forum and waiting for a Good news.

    ...And we are working hard to provide those good news
    Have a good weekend!
    Francis.

  • I only want sync SOME videos, not all, is there a way to do it ?

    Hello guys!
    I want to sync only SOME videos, not ALL... is there a way to do it ? i tryed to did a "smart folder" with iPhoto, for select last 6 months videos, but when i try to sync to iPhone, it doesn't sync none video, the only way is selecting "incude videos" (but i wont want to, because it will sync ALL videos, i only want some of them)
    Thanks!
    System:
    Yosemite
    iTunes 12

    Hi,
    Unfortunately this feature is not included in Firefox at this point, but you can suggest it by following the instructions below.
    The people who answer questions here, for the most part, are other Firefox users volunteering their time (like me), not Mozilla employees or Firefox developers.
    If you want to leave feedback for Firefox developers, you can go to the Firefox ''Help'' menu and select ''Submit Feedback...'' or use [https://input.mozilla.org/feedback this link]. (You'll need to be on the latest version of Firefox to submit feedback). Your feedback gets collected at http://input.mozilla.org/, where a team of people read it and gather data about the most common issues.
    Hope this helps!
    Curtis

  • I just bought a new Mac and I want to transfer some data (not all) from my old Mac.  Basically, I want to move my itunes library, iphoto library, and a few documents.  I have not even turned on my new Mac yet.  Is the best way by an external hard drive?

    I just bought a new Mac and I want to transfer some data (not all) from my old Mac.  Basically, I want to move my itunes library, iphoto library, and a few documents.  I have not even turned on my new Mac yet.  Is the best way by an external hard drive?

    If both have Firewire ports then you can accomplish your goal by using Target Disk Mode. If this is not possible then you can do using an external drive or if you have a local network connect both to your network and use filesharing between the two computers.
    File Sharing on Macs
    Mac 101- File Sharing

  • I have intel mac  10.411, want to access iTunes, won't let me unless upgrade tp itunes 10, but it needs OSX 10.5. I just want to download some music, not upgrade my operating system. It's not THAT old. Ideas?

    I have intel mac  10.411, want to access iTunes, won't let me unless upgrade tp itunes 10, but it needs OSX 10.5. I just want to download some music, not upgrade my operating system. It's not THAT old. Ideas?

    As long as you don't need all the bells and whistles of the iTunes Store such as Ping, and don't need to sync an iOS device running iOS 4.x, then iTunes 9.2.1 should work for you. It should be available via Software Update, but if not, you can still get it here:
    http://support.apple.com/kb/DL1056
    but it would be best to upgrade your Mac to Mac OS X 10.5 or 10.6, since it's probable that eventually the iTunes Store will no longer support iTunes 9.x.
    Regards.
    P.S. Mac OS X 10.4 was discontinued three and a half years ago, so yes, it's getting rather long in the tooth. Cheers.

  • HT4915 I want some music to not upload to iTunes Match. How do I do this?

    I want some music to not upload to iTunes Match. How do I do this?

    https://discussions.apple.com/thread/1343532?start=0&tstart=0
    This issue just the other way around its a hardware issue

  • No document number when some stores posting for cash balancing

    Hi experts,
    I have a problem for SAP SRS(SAP Retail Store) system. Please help me.
    no document number when some stores posting for cash balancing
    thanks.

    Hi,
    For this pls contact with MM consultant or put this query in MM forum.
    Anil

  • How to maintain petty cash dept wise cash journal entry(FBCJ)?

    Dear All,
    Cash journal fund transfer department to department (ex. Finance dept to Sales dept)
    I want maintain dept wise petty cash, how can do it explain deeply.
    *I example given one scenario
    *Com.code : (AB01) ABC LTD
    Finance dept sending Rs.10000
    Sales Dept Received amount Rs.10000
    Sales dept will do it some expenses through cash.
    I want intercompany department wise how will be maintain petty cash in sap.
    I have some solution in my mind that solution should be correct or wrong i donu2019t know suppose i done wrong correct me, Create new cash journal dept wise through, T.Code: (FBCJC0) and then we have to maintain cash journal in dept wise. Otherwise any solutions there explain detail.
    Thanks & Regards
    Selva

    Dear SAP Student
    It is just like inter unit cash transfers.  Also each department is spending cash on its own.  Now that I would like to know the balance cash departmentwise.
    As you said if I receive and pay through vendors I would be in a position to know only vendor wise balances.  It does not serve my very purpose of deparmentwise balance of cash. 
    I agree with Selva to go in for creating deparmentwise cash journals in the company code since each deparment is incurring expenses also and each department wise balance is also required. 
    Aravind

  • Calculation of change amount for cash payments via cash desk, release 602

    Does anyone know how to get the change amount to calculate for cash payments via cash desk?
    I am only able to enter the amount in each payment type tab and then the payment amount in the summary. The total of the individual payments must add up to the summary payment amount or I get an error.
    How then if a customer wants to pay $20 towards their account and they give me $50 in cash, do I get the change of $30 to display?
    Any assistance would be appreciated as the old version of cash desk had a "given" and "back" field that no longer exist.

    Was not an error, just using the fields the wrong way around. So enter the amount received in the seperate tabs and the amount that is being paid to the account in the summary payment amount field. After you hit post, the change field is filled.
    Is another issue though as if pay by multiple payment types, system allows you to give change greater than the amount of cash received. This should not occur as people could use this process to cash for cheques or credit card payments. Especially an issue as cheque could be returned.

  • Who wants to have fun problem solving a more complicated issue?

    My main problem is I don't have permissions to access a Time Machine back up of all my files.
    Here's what happen: I was looking one day at how much space I was taking up with my 2009 MBP. I had about 209 GB of "other". Curious as to what this "other" was I ran Disk Inventory X to find out, but I ran into a problem. I inherited this computer from my mother who at some point turned on FileVault. Well FileVault wouldn't let me find out what that "other" space was, so I decided to try to disable it. But I could not disable it without 117 GB of free space. Unfortuantely all this "other" space took up so much that I couldn't free up enough space. I'm not exactly sure how, but somehow I finally figured out that it was a Sparse Disk Budle Image that was taking up the space. I did some research to try and figure out what this was and in my research determined it was a copy of basically everything on my computer. I had a back up of everything so I thought I could delete it all and be fine. So I did. When I did that it basically made my account unuseable because my info was wrong and all kinds of crazy stuff started happening. So I jut decided to re-image it with Mountain Lion. Now that I have re-imaged it all everything is new again I am trying to get my information back on. I understand that if I back up from Time Machine it will probably put back on FileVault, thus throwing this situation into a loop, so I don't want to do that. I really just want my 20 GB of photos back from my iPhoto library, but everytime I try to access my User account on my external hard drive it tells me I don't have permission. I tried to go into Disk Ultility and and repair permissions but it is greyed out. I'm out of ideas... I'm not computer illiterate, I actually work for an Apple reseller so I know my stuff on this. But i think I messed everything up when I deleted the Sparse Disk. I don't know. Can someone help me?

    The sparsebundle was the backing store of your FV home directory. When you deleted it, you destroyed all your data. Legacy FV has poor compatibility with Time Machine. The sparsebundle is backed up only when you log out. You'll have to find the last such snapshot and restore from it.

  • Hey, I have $2350-2400 and I want some proper guidance for the macbook pro

    HEY!!!
    Guys I will try to make this as easy as possible!
    First let me tell you I am 15, I love graphics, music and literature and I have no credit card, my iTunes account has no money, I'm using an account that doesn't require credit cards! So (ugh) I buy all the free apps
    Anyway
    Dad gave me $2400 to buy a macbook pro and keep the change but since I live in Italy, I have to convert them to Euros.
    $2400-1821 EUR
    So I came up with 2 conclusions and I just want some opinions on which is the smarter decision.
    Well apparently there are 4 types of laptops I can get right now from the macs.....
    to make this as simple and as easy as possible (and to show off my ICT skills ) I made a table which includes
    1) the laptop mentioned
    2) the price in dollars (which I got directly from the apple store in the US)
    3) the price in euros (which I got directly from the apple store in Europe)
    Macbook Pro Kind
    Price in dollars
    Price in EUR
    13-inch: 2.5GHz
    $1119.00
    1249.00 EUR
    13-inch: 2.9GHz
    $1499.00
    1549.00 EUR
    13-inch: 2.5GHz with Retina Display
    $1499.00
    1549.00 EUR
    13-inch: 2.6GHz with Retina Display
    $1699.00
    1749.00 EUR
    But you can install somethings on to your laptop right there in the shop and I wanted two things,
    1) pages: I thought would help with my writing because I write poems, novels, stories, etc
    2) numbers: this program just deals with spreadsheets and charts and just the mathematical area and thought that this would help when doing A levels and GCSE math
    3)keynote: This is basically like power point and it just makes presentations.
    each of these programs are 18 EUR
    One more thing, since I am planning on using this laptop for several years, I change  changing countries often and so the laptop can come with an adapter that works in both European and American countries
    But thats 80 EUR
    The laptop (the edition i want) is 1749 EUR
    that means with all these additional stuff
    I calculated it on the apple store
    1749.00 EUR + 18 EUR + 18 EUR+ 18 EUR 80 EUR = 1883.01 EUR
    If we were in america then according to the website's store
    $1699 + $19.99 + $19.99 + $19.99 + $79.00=  $1847.96
    I'd be buying the SAME amount of things in the States for $1847.96 and I'd have 552 dollars change but in Italy everything would cost 1883.01 EUR which is the equivalent of $2481.61 which is more expensive than the US!
    BUT
    You have to consider the fact that this is with all the additional costs
    The additional things I thought I'd need
    If I said "no just buy the laptop"
    then the correct price in dollars is $1699
    the correct price in euros would be 1749 EUR
    the laptop only. No extra features.
    1749 EUR in Dollars would be $2305!
    Exactly $2305!
    That means I would only have had 95 dollars difference.
    Anyway the bottom line is all these additional things that I was talking about, the softwares and everything, they're going to help me in the near future, not RIGHT now.
    So what I can do is just buy the laptop and then as I progress in to year eleven, slowly by slowly, I can start buying the softwares.
    I'm sorry I'm unburdening ALL these different information on you, but I just wanted to approach this from as many angles and be as aware of all the variables as possible.
    SOOOOOOOOOOOOOOOOOOOOO
    (THIS IS THE CONCLUSION)
    OPTION ONE
    Buy the 13-inch: 2.6GHz with Retina Display Macbook Pro for 1749.00 EUR including all the additional features (the three softwares and the adapter which together have the total value of 134 EUR)
    Therefore the total amount of money we'd be spending is
    1883.01 EUR
    That means the total cost of everything would be $2481.62 and I'd get no difference
    OPTION TWO
    Buy the 13-inch: 2.6GHz with Retina Display Macbook Pro for 1749.00 EUR and then when I am 16 or 18 I buy these softwares with a credit card and apply them for my A levels later.
    That means the total amount we'll be spending is
    1749.00 EUR
    Which is $2305
    I will have $95 (72 EUR) pocket money.
    (BY THE WAY, MY PARENTS WORK FOR THE UNITED NATIONS AND DON'T PAY VAT OR SOMETHING AND SO WE KIND OF SOMEHOW GET A 20% DISCOUNT SO THE PRICES WILL BE A BIT OFF AND CHEAPER.... I JUST CAN'T BE BOTHERED TO DO ALL OF THE CALCULATIONS BUT YEAH.....................)
    Thanks for reading
    Please reply ASAP I'm buying the mac extremley soon.....

    Never heard of .MOD format, but generally VLC player will play most any format.
    It's free, open source so no harm in trying:
    http://www.videolan.org/vlc/

  • Some videos not showing up on AppleTV from iMac's iTunes library

    Having a strange problem. Not sure if it is an iTunes problem or an AppleTV problem but I will try here first.
    I have several videos in my library, some of which are digitized home videos I edited/rendered, others are AppleTV converted DVD's I own. For some reason, many of them are not showing up on my AppleTV when I go into "Computers" off the main menu and select my iMac with the iTunes library of them. Some show up, but more and more do not. They are all properly formatted and done so using Compressor settings for AppleTV. No idea why some are not showing up.
    If you look on the iMac with the library on it, they all show up fine. And if I try and play the video on my iMac but tell it to use AirPlay to play the video on the AppleTV, it plays just fine on the TV/AppleTV. I do have Home Sharing turned on for ALL my media and I also use iTunes Match service.
    When I try and use my iPad to access videos under the "shared" option and select my iMac's iTunes library, I get the same incomplete list. So I am thinking it's the iTunes library that's sending out an incomplete list for some reason. No idea why.
    I have tried drag-and-dropping the videos into the iTunes library as well as using the "Add to library" menu command, neither makes a difference.
    Any suggestions?
    Thanks.

    Also - i had a similar issue - lots of movies in itunes - not showing up as selectable on apple tv - i found that you have to go to "list" in itunes and select any movies i wanted to be selectable when i switched to the apple tv device - can someone please create a word for - "my software changes and somehow i'm an idiot for not knowing what magic the programmers are throwing down" - this too will change in the future - just need the happy customer service types to maintain a voice with the programmers and bottom line guys and gals.
    bold = my answer
    italics = my soapbox, nostradamus like, prediction of the future

  • I have a music library on an iMac and I got a new iPhone and a new MacBook Pro and I want some of the songs from the iMac library to be on my phone and my MacBook Pro and I have a new Apple ID on my phone and my Mac book pro

    I have a music library on an iMac and I got a new iPhone and a new MacBook Pro and I want some of the songs from the iMac library to be on my phone and my MacBook Pro and I have a new Apple ID on my phone and my Mac book pro, is this possible if so how do I do it?

    Providing specifics on all the ways to do this will take more time than I am willing to spend here these days.  You can do some of this with Home Sharing.  You can transfer the entire library from one computer to another, If you do that you can delete what you don't want from the transferred library.
    Quick answer if you use iTunes' default preferences settings: Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive. Open iTunes and immediately hold down the option (alt) key (shift on Windows) so you get a prompt to select a library, then guide it to the 'iTunes Library.itl' file in the moved iTunes folder. If you put the copied iTunes folder in the default location of Macintosh HD > Users > *User Name* > Music then you don't even need to start with the option key held down, iTunes will automatically look for it there. (Make sure there isn't anything already in the iTunes folder there that you want to keep since you will be replacing it with the one you are moving.)
    You do not want to use a new AppleID.  Change the  AppleID on the new phone to the old ID.  Purchases made with one AppleID cannot be transferred to a different one and it will be a royal pain to manage two Apple IDs.
    Change iTunes Store account on an iOS device - Log out of your current account with Settings.app > Store (Settings > iTunes & App Stores on iOS 6) > tap on your AppleID. Log in with a different account. Note, turning on automatic downloads or re-download past purchases may tie the device to that account for 90 days - http://support.apple.com/kb/HT4627 https://discussions.apple.com/message/18484935 - "In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account") When you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again."

  • Some, but not all, podcasts existing on the iPod no longer appear in iTunes. Different podcasts have been affected at different times, after changes in the state of the iPod. Only podcasts are affected.

    I have not seen this precise issue addressed anywhere. I don’t know if it’s an iTunes or an iPod problem:
    - Some, but not all, podcasts existing on the iPod no longer appear in iTunes;
      this, after normal behavior for more than a year since purchase of the iPod.
    - Different podcasts have been affected at different times, after changes in the state of the iPod.
    - Only podcasts are affected.
    - This concerns an iPod nano 6th gen. and iTunes 11.0.2 (26) on System 10.6.8
    - The only change to iTunes, the Mac, or the iPod is that just before this condition began
      I’d begun syncing an iPhone via iTunes.
    I sync manually (“manually manage music and videos”). The first time this happened, I wanted to delete seventeen podcast episodes (all belonging to one podcast) existing on the iPod — but they didn’t show up in iTunes. I tried re-downloading them and re-syncing, to see if the new versions would somehow “re-link” to iTunes. They didn’t. Only one — new — episode appeared in iTunes.
    I ultimately reset the iPod and manually resynced all the podcasts I currently had on iTunes. That worked, though I had to painstakingly add in all the other content deleted by the reset.
    So: after that reset and manual sync, all podcasts and episodes on the iPod were visible to iTunes and I was able to delete the podcast and its — now 18 — episodes I’d wanted to get rid of to begin with. But the next time I connected the iPod, only 8 podcast episodes out of 21 episodes total existing on the iPod were visible to iTunes. These are different podcasts; I’d deleted the original “invisible” ones.
    By “visible,” I mean in the “Podcasts” list view under “[name]’s iPod” in the iTunes sidebar. If I select “[name]’s” iPod in the iTunes sidebar and the “Podcasts” tab, all podcasts and episodes are visible, though greyed out because I’m set to sync manually. It’s unclear to me if these are the podcasts on the iPod or those currently in iTunes, as they are currently the same. If I switch to syncing automatically, all content on the iPod will be lost again, so I’m not up to trying it at the moment.
    As I said,  this involves only podcasts. All other content on the iPod does appear in iTunes.

    I have the same problem- i see my movies in the ipod section in itunes and they even show as mpeg4 in the 'kind' section but they dont have that small TV icon next to them. if i play these in itunes, they play fine- but try playing them on the ipod and all you hear is the sound and no picture. All videos that i manually transfer work fine in the beginning- its when i hook up the ipod to the comp again and start itunes- they start showing up without the 'tv' icon!! i have to again transfer them from the itunes library to activate them as videos.
    Need Help!!!

Maybe you are looking for

  • How do i use wifi on my imac

    I have an old imac that is still great for word processing and playing DVD / music but its now in a place in the house away from the router and the cable wont reach. Basically it would be far easier if this desktop mac had wifi. is there anything tha

  • Photo's in different location (not default)?

    After backing up, I've recently rebuilt my system. I'm now in the process of re-installing the software, copying files back over etc. I have 2 partitions on my drive now - System & Data. iPhoto is running from the Apps folder on the System partition,

  • Unable to  start weblogic(OSB) server in OEPE

    Hi, I have  oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-win32 for OEPE and osb_generic_11.1.1.7.0 for OSB.when I add server (weblogic 10.3 ) to eclipse its showing authentication failed and I am not able to start server. Any help is appr

  • N86 photo storage question.

    Is it possible to set up a separate folder in which to store photos, so they don't appear in the albums? For example, if I am using the phone like a flash drive, just as a means of transferring files from one location to another.

  • I just updated my iPhone 4 to IOS 7 and now I can't set up my iMessage and FaceTime- Any suggestions?

    Same as the subject matter!