Setting characters to italic within a textframe -- two problems

Hi!  I'm trying to set the font for specific characters (or words) to italics within the contents of a textframe.  The font I'm using is Helvetica.  The first problem is that when I try to set the .Italics property to TRUE, there is no effect, i.e., the text does not appear italicized.  For example:
          With tfrmTopLine2 '(This is a text frame object)
                .Contents = "Harry met Sally"
                .TextRange.CharacterAttributes.TextFont = appIll.TextFonts.Item("Helvetica")
                .TextRange.CharacterAttributes.Italics = True
            End With
The text does not appear italicized.  For the Helvetica font I'm using, the italics type face is named "Helvetica Bold Oblique".  I've tried referencing that font name but it doesn't work, i.e., the font remains unitalicized. 
Now, assuming that I (we) can figure out how to set italics, then I need to change just specified characters within the text frame to italics.  In the example above, imagine that I wanted to just make the word "and" italics so that the sentence would read, "Harry met Sally".  I will always know the positions of first and last characters of the word to change and I have no problem looping through the relevant characters to make the change... ONCE I know what I need to do to make a character italics.
Thanks for the help!!!
Bob

I solved this myself so thought I'd share what I learned.
When setting a font to other than the default regular style of that font, you need to use the precise name of the sub font.  For example, I discovered I needed to use the following:
     appIll.TextFonts.Item("Helvetica-Oblique")
The challenge is that I didn't know that precise name.  So I programmatically interrogated a textFrame that I had already set the font as I wanted it in Illustrator.  Basically, I wrote a textFrame to a Ai document, went into debug mode right after that, then manually changed the font to what I wanted it to look like, then did the following:
MsgBox tfrmTextFrame.TextRange.CharacterAttributes.TextFont.Name
That gave me the name I needed to refer to in code.

Similar Messages

  • How to show Greek characters in Italic style

    How to show Greek characters in Italic style
    Hi all, I'm tryng to resolve a problem with the Greek characters
    I need to display labels in two languages, english or greek inside my report.
    At the beginning of the report I have a placeholder with the xml code : *<?param@begin:p_language?>*, so I can understand inside my report if the user chose the Greek or English, and then I have many placeholders (labels) which have to be written in Greek or English.
    If the language chosen is English, I don't have any problem to show my labels bold or italic in every fonts
    Inside the placeholder I wrote the following code:
    *<?xdofx:if $p_language = 'Ελληνικά' then 'Οργανισμός' else if $p_language = 'Αγγλικά' then 'Organization' end if?>*
    I can chose font, style and bold/not bold directly from Word and when I run the report in pdf I see exactly what I chose.
    If the language chosen is Greek....I see always the label in Arial, NOT BOLD and NOT ITALIC...
    In order to see Greek characters BOLD:
    a) I added (under the ADMIN tab/Runtime Configuration/Font Mappings/ ) a font named Arial and I addeda target Font named Arialbd.ttf under the directory: D:\Oracle\Oracle_Homes\BIP_101341\jdk\jre\lib\fonts
    b) I changed the font (from word) to Arial
    Now, ONLY with tha ARIAL font I can see my labels in greek bold, but I can't still see them in italic style.....
    So, I tried to force these condition inside the placeholder with the following code:
    *<?if:$p_language = 'Ελληνικά'?><xsl:attribute xdofo:ctx="inlines" name="font">Times New Roman</xsl:attribute><xsl:attribute xdofo:ctx="inlines" name="font-style">Italic</xsl:attribute><xsl:attribute xdofo:ctx="inlines" name="color">red</xsl:attribute><xsl:attribute xdofo:ctx="inlines" name="font-weight">bold</xsl:attribute>Οργανισμός<?end if?>*
    ...but I continue to see the labels in Greek only bold, red but not in Italic Style......
    Also adding another font called Arialbi.ttf (Arial bold Italic)...I can't see my labels in Greek bold with Italic Style....
    Anybody had the same problem with another alphabet different from the latin one ???
    Any help will be appreciated
    Thanks in advance
    Alex

    Hi Chris,
    Thanks for your reply.However I still have some problems.
    I couldnt get jpdk 3.0.9.0.4 version the latest version that I
    got was jpdk 3.0.9.0.2.
    I tried the 3.0.9.0.2 version and it gave me the below error.
    Error-
    sun.io.MalformedInputException
         at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java,
    Compiled Code)
         at java.io.InputStreamReader.convertInto
    (InputStreamReader.java, Compiled Code)
         at java.io.InputStreamReader.fill
    (InputStreamReader.java, Compiled Code)
         at java.io.InputStreamReader.read
    (InputStreamReader.java, Compiled Code)..........
    Can you guide me regarding this ???
    Regards,
    Mandar.

  • Stop escaped characters from resolving within String class.

    Hello,
    Is it possible to stop escaped characters from resolving within the String class?
    For example, I define a character array,
    char[] c = {'0','\\','n'}
    and I want to create a String based on this exact sequence (0\n). However, when I call the String constructor String(char[]), it resolves the \n sequence into the newline character, creating a String of length 2 not 3.
    I'm not very familiar with the innards of the Java compiler (does "xyz" translate to char[]{'x','y','z'}?), so maybe this is something very basic.
    Does anyone know if there is a flag that can be set somehow before I create a String instance (it appears that no String constructor supports this kind flag)?
    Or perhaps is there a method in the standard Java release that escapes all escape characters in a character array...? I'm curious if there is a simpler way (like a flag), because the method approach seems superfluous.
    Thanks,
    Brien

    What do you mean?char[] c = {'0', '\\', 'n'};
    String s = new String(c);
    System.out.println(s);does give the string 0\n...
    And by the way, it's not the String class that transforms \n to the linefeed character, it is the compiler..

  • When I set up multiple home pages, I get two NEW pages when I click "home"

    Firefox 19.0.2 on XP
    I have always had firefox set up to open two page, so my home page setting reads
    https://www.google.com|https://www.google.com
    When I open Firefox, I get two tabs, both on Google. If I opened a 3rd tab I got a blank page. Just what I wanted.
    Now, suddenly - when I open Firefox, I get my two home pages, but if I'm in Page 0 and click HOME, I get TWO MORE tabs open to my home page (for a total of 4 pages).
    I read online to replace the pipe with %7C but that causes a -27 Service error.
    Something changed inside FF in the latest updates ... how do I get the expected behavior back?

    I have had the same original problem here as dbdataplus12 for a while now concerning having multiple tabs set as home page.
    For my use, I have 4 tabs set up as home pages - each tab being set to a different web address, as I always use all 4 websites whenever I start any browsing sessions.
    I had given up hope of trying to find an answer to resolve it or at least find out why it happens.
    If it's just because it's the way FF works then so be it, and I'm stuck with FF doing something that, as far as I'm concerned, it shouldn't really be doing that way - but I'll have to put up with it anyway ;)
    But having come across these replies to dbdataplus12 query it's prompted me to have to post here.
    I can see why dbdataplus12 basically gave up on trying to get a clear answer to his query. "That said, I'm bored with this entire conversation - and now I will do what true Americans now do in cases like this - I will lower my expectations. "
    So maybe I can explain better what I see as my problem with multiple home pages, what is happening within FF and why I think that it shouldn't be doing things that way, and what I think FF should be doing instead.
    If it turns out that I'm just expecting too much from FF or the people who program FF, or maybe my expectations are too high to have something so obvious be able to be done - that just doesn't happen in FF, or maybe just plain wrong of me to expect certain things from a tool such as FF - then so be it ;)
    As dbdataplus12 said " ... if I set up my home page option with TWO home pages (google | yahoo) then when I open FF I get two tabs with their respective pages loaded."
    When I startup FF I get my 4 tabs opened to their respective web addresses. So far so good :)
    I then use those 4 tabs during my session, and again so far so good ;)
    The problem then happens when I wish to go to my home pages again.
    On clicking the Home button, a new set of 4 tabs open up, each going to their respective web address as they are supposed to.
    Why aren't the original, existing tabs used to go to the home pages?
    I would have thought that it was obvious that when I click on the Home page button that the 4 tabs that are open go to the home pages.
    If I had closed one or more tabs then I would expect FF to open new tabs as required, and use those tabs to go to the relevant home pages.
    If I had opened new tabs myself during my session to visit other web addresses, I would expect that the first tabs be used to go to the Home pages - any other tabs that may be open would stay on their relevant pages.
    That's what I would expect to happen.
    Not for FF to just open up 4 new tabs.
    As I say, to me, it's just plain obvious.
    The first tabs onscreen should be used to open up any Home pages set up, so that whenever the Home page button is pressed those tabs are used.
    And for FF to open up additional tabs, if tabs had been closed and are needed to enable all the home pages to be shown.
    As I say, to me, it's just plain obvious.
    So, if it's just that FF doesn't work that way - then so be it. I'll accept that as the answer and have to put up with new tabs opening every time I press Home ;)
    But maybe someone, somewhere, could think about altering FF so that it uses existing tabs etc instead of just opening new ones. Maybe you could have a setting in the preferences to switch the option on or off to reuse tabs whenever the Home button is pressed.
    Just a really, obvious idea ;)
    Thanks for reading - and hopefully replying.
    And hopefully taking the idea onboard ;)

  • Trying to combine folders within LR4 from two separate drives without creating duplicates--sometimes it won't let me transfer to destination folder because it says files are there when they are not; other times, allows duplicates to transfer

    Trying to consolidate 261K+ of images within LR4 between two drives.  Someone who was "helping" me with my Library in LR4 for some reason took some but not all of the file folders from my main backup drive (M) and duplicated them onto a partitioned hard drive (E) directly on the computer.  The duplication is huge, so I am trying to condense them all back onto the original backup drive M, particularly since I believe there are also folders on the partitioned backup drive E that do not appear on the main one M, and there are many more file folders on M that are not on E, so that is the destination drive.
    CONSOLIDATION:  When I try to drag either the file folders or the individual files from the duplicate drive E to the original drive M to combine the two drives since the folders in many cases for some reason are not identical, sometimes LR4 says the files already exist when they clearly don't. Other times it allows me to drag and drop all files, even if the exact duplicates are already on the destination drive, thereby doubling the number of files per image and creating more duplicates.  Right now I am opening each file folder on the duplicate drive E, looking at what extensions and file names are there, scrolling to the original drive, making sure they appear to be identical, then going back to the duplicate drive E, deleting the images in the folder, removing the folder, and moving to the next folder on the duplicate drive E.  *There has got to be a simpler way.*
    CONSOLIDATION APPROACH: I did start to create file folders names A, B, C and group file folders under them to reduce clutter, since those header folders can be closed down when not in use, but now I am wondering if I should have done that alphabetization to the main backup drive rather than to the partitioned backup drive.
    My goal is to consolidate the two drives down to one, delete as many images along the way that I know I will never miss, then backup the catalog and export it to an external drive and then copy that to yet another drive for offside storage.  Does this sound like the proper plan?  Last time it took almost 24 hours and over a terabyte to export the catalog.
    DUPLICATION:  I also have many file folders that have the exact same image in them.  One portfolio image may actually be in eight different folders, with the exact file, file name, file size, and date, even though I always have checked "no duplicates on import,"  How can this be? What is the best way to sort through duplicates?  Why are the files in some of the duplicate folders not in numerical order? If I do a search and call up a file # and find 15 duplicates, the only way I can find where those duplicates reside is to take each duplicate, right click to Locate Folder in Library, then once I find it, I have to go back to All Photographs>Text.search for file #, go to the second duplicate, right click to Locate Folder in Library, then once I find it, I have to do it all again.  Is there a simpler way to see all the occurrences in their respective folder locations at once?
    SEARCH BY FILE FOLDER NAME ONLY: I also find I can't search for a file using a folder name (for example, "John_Doe").  I can only search by file #, keywords, or camera/lens/date, etc.  Why will it not work to use All Photographs>Text>search for Doe? In other words, if I didn't keyword the individual files as John Doe, I can't search for them by that moniker.
    BACKUP:  It also appears that the only way I can back up the catalog is to shut down LR.  Really?!
    FOLDER LIST PRINTOUT: Is there a way to print out the Folder list (other than a screen shot)? I have so many file folders on each drive since I sort not by Year/Month/Date but by subject. It makes trying to compare duplicate folders quite unwieldy. 
    SLOW RESPONSE:  And finally, as though that weren't enough, why does LR4 continually blink to a white screen after each keystroke?  Takes forever just to be able to click through images, view info after hovering, etc. All other programs are closed down and the operating system shows very little memory being used.

    A brief and probably non-helpful answer: I know of no way to eliminate your large amount of duplicates other than by repetitive, tedious manual effort.
    *There has got to be a simpler way.*
    I hope you're right, but I don't think there is a simpler way.
    BACKUP:  It also appears that the only way I can back up the catalog is to shut down LR.  Really?!
    Yes, really

  • I cannot figure out how to set my apple id to use: itunes (two of accounts), apps store and Itunes store. How do I make one password that will be recognixed by all these devices?

    I cannot figure out how to set my apple id to use: itunes (two of accounts), apps store and itunes store. How do I make one password that will be recognized by all these devices? My apple id is constantly not working.

    Hi Lrwill,
    If the apps that are on your son's iPad were purchased under his Dad's Apple ID, then signing your Apple ID onto the iPad will not help you with updating those apps.
    Also, if the iPad was sync'd with his Dad's iTunes library, then hooking it up to your computer/iTunes library, will require you to reset the iPad, and everything that was loaded under the other Library and Apple ID will be wiped out.
    Can you provide a little more info about what was set up under which Apple ID and what iTunes library the iPad was sync'd with?
    Cheers,
    GB

  • How to Set up Family Plan when you have two Apple IDs?

    I stopped short of setting up Family plan because my wife and I have two Apple IDs each: One for iTunes ad one for iCloud.  This was caused by migrating from long ago Apple "cloud" services.  
    The set up seems to assume you have a single ID for each person and there are no instructions to set it up using hyour current iTunesa and iCloud IDs.
    Has anyone successfully set up Family Plan while they have two sets of Apple IDs? 

    finally I found someone else with my dilemma.
    I have my iTunes/AppStore ID with all my purchases and my iCloud ID with everything else.
    this is a major issue that needs to be addressed.
    thank you.

  • I want to set-up a network with our current two laptops for a family of 4 w/unique 4 profiles. I'd like everyone to be agnostic about which computer to log into and use but still have private docs and apps (i.e.mail/facebook). How best can I do this?

    I want to set-up a network with our current two laptops for a family of 4 with unique 4 profiles.  I'd like everyone to be agnostic about which computer to log into and use but still have private docs and apps (i.e. mail/facebook).  How best can I do this?

    iCloud Photo Sharing FAQ - Apple Support
    http://www.fatcatsoftware.com/iplm/Help/accessing%20an%20iphoto%20library%20on%2 0another%20mac.html

  • Mapping with Scd operator set to type 2 reading source records two times

    Mapping with Scd operator set to type 2 reading source records two times.Records selected count being displayed at the end of execution is double the source record count.This possibly is affecting the performance of the mapping.
    Is this a bug in scd type 2 operagtor in OWB 11gR2.How to rectify this umwamted double loop through the source data selectiom?

    Hi Roelant,
    I think it is important to be aware that although Paris - 10gR2 - is not actually buggy (in this respect!), it is really quite idiosyncratic in exactly how it processes SCDs.
    I followed up on your and Mark's comments, and did an in depth analysis of this topic. It is at http://www.donnapkelly.pwp.blueyonder.co.uk/documents/OWB_10gR2_SCD.pdf
    My conclusions are perhaps of interest to anyone considering doing SCD processing with Paris.
    I'll be doing a follow-up this weekend, and publishing a sort of 'how-to-do-it' guide.
    Cheers,
    Donna
    Message was edited to add the words: "in this respect"

  • HT5463 has anyone enabled do not disturb setting and it works? i have two 4s and both still ring in mode

    has anyone enabled do not disturb setting and it works? i have two 4s and both still ring in mode

    Is your screen locked when this happens? Do Not Disturb only functions when the screen is locked.
    See here for a description of how Do not Disturb works: http://support.apple.com/kb/HT5463?viewlocale=en_US&locale=en_US

  • Set up Business Connector within SAP ERP 2005

    Hello!
    Which SPRO-Activity is responsible for setting up Business Connector within SAP ERP 2005 (only ABAP-Stack)?
    What is the effort should be regarded for this issue?
    Thank you very much!
    regards
    Thom

    Hi Tony,
    are you using gcj from Red Hat as Java? You can check this by
    rpm -qf `which java`
    This should point to either Sun JDK 1.4.2 for i386 and IA64 or IBM JDK 1.4.2 for x86_64
    Thanks,
      Hannes

  • The top two inches of my firefox screen seem non responsive i.e. unable to click on links or grab the scroll bar on the right hand side of the screen if it is within the top two inches below the tool bar

    It seems that for whatever reason, I am unable to click on any links, pictures, or anything really within the top two inches of my internet browser screen, it seems like a "dead zone'' of sorts.
    the tool bar is fine, and from about two inches down on the screen everything is responsive.

    The Yahoo! Toolbar extension has been reported to cause this issue.
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    You can keep an eye on this thread:
    *[[/forums/contributors/707748]]

  • Two problems with setting up arch. Keyboard layout and wifi card.

    Hi guys.
    I have installed arch on my old laptop (LG le express) and I have two problems.
    1. I wasn't able to create a Hebrew keyboard layout.
    2. I don't know how to install my wifi card. (Ralink 2500).
    as for one, I changed my xorg.conf to this:
    section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "XkbRules" "xorg"
    Option "Xkbmodel" "pc105"
    Option "XkbLayout" "us,il"
    Option "KkbOption" "grep:switch,grp:alt_shift_toggel,grp_led:caps"
    EndSection
    but it didn't work.
    As for 2, I have found this:
    https://wiki.archlinux.org/index.php/Us … eta_driver
    But I can't find how to install rt2x00
    Thanks

    If you edit the first post you can change the title, prepend it with [solved] (once all issues are actually solved). Also if you can post your working solution then it will be useful for others having similar difficulties. Please read the following links.
    Mark threads as [solved]
    Forum etiquette
    As for your wireless issue, which tool are you using? A quick google around seems to suggest that netcfg in combination with wpa supplicant can connect to LEAP encrypted networks, eg this thread. Are you also aware that there are graphical tools to do this for you that you may find easier, such as wicd?
    Last edited by quigybo (2010-11-12 01:56:01)

  • I have a client that uses Windows that has recently told me she can no longer open the PDFs I send her. I can't find this elusive "Always Send Windows-Friendly Attachments" setting that I have read may solve my problem. Can someone get me there?

    I have a client that uses Windows that has recently told me she can no longer open the PDFs I send her. I can't find this elusive "Always Send Windows-Friendly Attachments" setting that I have read may solve my problem. Can someone get me there?

    Dear Dan,
    It was from InDesign that I was creating the shared pdfs. I was one of two Mac drivers in a corporate sea of Win users and had to make the change I mentioned in order for the Win users to see my pdfs for review. The difference from what you appear to be doing was that were all on an MS Exchange Server so the files were shared over the company's Exchange Server e-mail system. However, some of these files occasionally went to outside users via regular e-mail and those people had no issues either.
    So what I did was tested and worked for years.
    You might look at the Adobe forums or Knowledge Base to see if that is a reported issue with newer version of CS. I was on CS2 when I was doing this, and the other Mac driver was on CS3 but had no problems either.
    Some Win users I've talked to find a problem opening some pdfs (not mine) in general and found they had to open Reader first and them open the file from Reader's File menu. That most often happened if the client was using an outdated version of Reader.

  • Two problems with two different classes.

    im having two problems: i get nothing with the printConferences() method inside ReferenceBook class, the arraylist size is equal to zero. and my printSchoolsAndCopies() and schoolsAndCopiesToArray() methods which are inside TextBook class, give exceptions:
    Exception in thread "main" java.lang.ArrayStoreException at java.lang.System.arraycopy(Native Method) at java.util.ArrayList.toArray(ArrayList.java:304) at project3.TextBook.schoolsAndCopiesToArray(TextBook.java:64) at project3.TextBook.printSchoolsAndCopies(TextBook.java:74) at project3.BookTester.main(BookTester.java:27) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)
    all you need to read is TextBook and ReferenceBook class, but i added the tester and BookCatalog, which is an arraylist of books.
    here are my TextBook and ReferenceBook classes and the tester, there are two abstract classes Book and TechnicalBook, but i wont post them unless anybody needs them, i presume not.
    * TextBook.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class TextBook extends TechnicalBook{
        private ArrayList <String> schools;
        private ArrayList <Integer> numberCopiesForSchool;
        private String [][] schoolsAndCopies;
        public static final String TEXTBOOK = "Textbook";
        /** Creates a new instance of TextBook */
        public TextBook(String author, String title, int numberPages, int copiesSold,
                double price) {
            super(author, title, numberPages, copiesSold, price);
            schools = new ArrayList();
            numberCopiesForSchool = new ArrayList();
        public int getNumberCopiesForSchool(String school){
            Integer temp = null;
            for(int i = 0; i < schools.size();i++){
                if(schools.get(i).equals(school))
                   temp = numberCopiesForSchool.get(i);
            return temp;
        public void addSchool(String school){
            Integer one = new Integer(1);
            schools.add(school);
            // number of copies for the school is initially 1
            numberCopiesForSchool.add(one);  
        public int getNumberSchools(){
            int count = 0;
            for(int i = 0; i < schools.size(); i++){
                if(schools.get(i) != null)
                    count++;
            return count;
        public void addCopiesForSchool(String school, int copies) {
              for (int i = 0; i < schools.size(); i++) {
                        if (schools.get(i).equals(school))
                   numberCopiesForSchool.set(i, numberCopiesForSchool.get(i)
                                + (Integer) copies);
        private void schoolsAndCopiesToArray(ArrayList <String> a, ArrayList <Integer> b){
            String [] c = null;
            String [] d = null;
            c = (String[]) a.toArray(new String[a.size()]);
            d = (String[]) b.toArray(new String[b.size()]);
            String [] [] schoolsAndCopies = null;
            for(int i = 0; i < c.length;i++){
                for(int j = 0; j < d.length;j++){
                    schoolsAndCopies[i] = c;
                    schoolsAndCopies[j] = d;
        public void printSchoolsAndCopies(String title){
            schoolsAndCopiesToArray(schools, numberCopiesForSchool);
            System.out.println("---------------");
            System.out.println("Schools and copies sold to each school for " + this.title+ ".");
            System.out.println("Schools:\tCopies:");
            for(int i = 0; i < schoolsAndCopies.length;i++)
                for(int j = 0; j < schoolsAndCopies.length;j++)
    System.out.println(schoolsAndCopies [i] + "\t" +
    schoolsAndCopies[j]);
    public String getClassName(){
    return TEXTBOOK;
    // overrides TechnicalBook toString
    public String toString(){
    return "Author = " + author + ". Title = " + title + ". Number of Pages = " +
    numberPages + ". Copies Sold = " + copiesSold + ". Schools using " + title +
    ". Price = " + this.getPrice() + " = " + this.getNumberSchools() + ". ";
    * ReferenceBook.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class ReferenceBook extends TechnicalBook{
    private ArrayList <String> conferences;
    public static final String REFERENCE_BOOK = "Reference Book";
    //private int numberConferences;
    /** Creates a new instance of ReferenceBook */
    public ReferenceBook(String author, String title, int numberPages, int copiesSold,
    double price) {
    super(author, title, numberPages, copiesSold, price);
    conferences = new ArrayList();
    public String getConference(int a){
    for(int i = 0; i < conferences.size();i++)
    if(i == a)
    return conferences.get(i);
    return null;
    public void addConference(String conference){
    for(int i = 0; i < conferences.size();i++){
    conferences.add(conference);
    break;
    public void printConferences(){
    System.out.println("-------------");
    System.out.println("Conferences made for " + this.title + ".");
    for(int i = 0; i < conferences.size(); i++){
    System.out.println("["+(i + 1) +"]: "+ conferences.get(i));
    System.out.println(conferences.size());
    public String getClassName(){
    return REFERENCE_BOOK;
    public String toString(){
    return super.toString();
    * BookTester.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    * @author Kevin
    public class BookTester{
    /** Creates a new instance of BookTester */
    public static void main(String [] args){
    BookCatalog catalog = new BookCatalog("Library");
    TextBook java = new TextBook("John", "Java", 5, 20, 5.00);
    TextBook beans = new TextBook("Mike", "JavaBeans", 6, 21, 5.00);
    ReferenceBook ref = new ReferenceBook("Jones", "Standard Class Library", 6, 23, 5.00);
    ref.addConference("Meeting");
    ref.printConferences();
    beans.addSchool("UTSA");
    beans.printSchoolsAndCopies("c++");
    catalog.addBook(java);
    catalog.addBook(beans);
    catalog.printCatalog();
    my BookCatalog class is fine, and everything prints out with out using the listed methods that give trouble.
    * BookCatalog.java
    * Created on April 20, 2007, 4:42 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class BookCatalog {
        private String name;
        private ArrayList <Book> bookList;
        /** Creates a new instance of BookCatalog */
        public BookCatalog(String name) {
            this.name = name;
            bookList = new ArrayList <Book>();
        public String getCatalogName(){
            return name;
        public void addBook(Book b){
            bookList.add(b);
        public void printCatalog(){
            for(int i = 0; i < bookList.size(); i ++){
                System.out.println("[" + i + "]: " + bookList.get(i).getClassName() +
                       ": " + bookList.get(i).toString());
    }thanks in advance

    everything runs now, but it doesnt sort them. it prints them in the original order: here is the revised BookCatalog and Tester, also when making sortByTitle static it gives non static variable errors so i have no idea. Thanks for helping me fix the errors, i have no idea why it doesnt sort.
    * BookCatalog.java
    * Created on April 20, 2007, 4:42 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    import java.util.*;
    * @author Kevin
    public class BookCatalog {
        private String name;
        private ArrayList <Book> bookList;
        //private Book [] bookList2;
        /** Creates a new instance of BookCatalog */
        public BookCatalog(String name) {
            this.name = name;
            bookList = new ArrayList <Book>();
        public String getCatalogName(){
            return name;
        public void addBook(Book b){
            bookList.add(b);
            public void sortByTitle(ArrayList<Book> list){
          if (bookList.size() > 1)
            for (int index = 1; index < bookList.size(); index++)
               insertItemByTitle(bookList, index);
         private void insertItemByTitle(ArrayList <Book> bookList, int index) {
                Book key = bookList.get(index);
                int position = index;
                while (position > 0 && key.getTitle().compareTo(bookList.get(index).getTitle()) < 0)   {
                    bookList.set(position, bookList.get(position-1));// = bookList.set(position-1, key);
                   position--;
                bookList.set(position, key);
        public void printCatalog(){
            sortByTitle(bookList);
            Book [] bookList2 = (Book[])bookList.toArray(new Book[bookList.size()]);
            for(int i = 0; i < bookList2.length; i ++){
                System.out.println("[" + (i+1) + "]: " + bookList2.getClassName() +
    ": " + bookList2[i].toString());
    * BookTester.java
    * Created on April 19, 2007, 8:02 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package project3;
    * @author Kevin
    public class BookTester{
    /** Creates a new instance of BookTester */
    public static void main(String [] args){
    BookCatalog catalog = new BookCatalog("Library");
    TextBook java = new TextBook("John", "Java", 5, 20, 5.00);
    TextBook beans = new TextBook("Mike", "JavaBeans", 6, 21, 5.00);
    ReferenceBook ref = new ReferenceBook("Jones", "Standard Class Library", 6, 23, 5.00);
    ref.addConference("Meeting");
    ref.printConferences();
    beans.addSchool("UTSA");
    //beans.printSchoolsAndCopies("c++");
    catalog.addBook(ref);
    catalog.addBook(java);
    catalog.addBook(beans);
    catalog.printCatalog();

Maybe you are looking for

  • How to sync two iphones to itunes acct

    i sync both my iphone 4 to one acct and now both are backedup the same-i want to be able to sync each phone seperatly-how do i do it??????????

  • How do I change just the user ID for saved passwords?

    I frequent a website where I have two completely separate User IDs and passwords, but Firefox will only save one or the other, not both. I have the same situation on other websites, and have no problem logging in with different IDs, but on this one w

  • After system crash itunes can't find my music

    my system had to have windows re-installed due to a variety of problems. now i can't fin over 20GB of music. i have it on my iPod, but i can't see it on my computer. any suggestions?

  • SQL%Rowcount in Forms 9i

    How can I get number of rows which was REALLY updated in database? I want to use VPD with select allowed and update restricted policy, so when I update rows from SQL*Plus, I can see if no rows was updated, but when I update the same table from Forms,

  • Dvd and cd/r audio connection to 875P Neo

    Hey - I'm new to the msi forums - so pardon if this is too newbie or too general - but I did try to search the archives and knowledge base and FAQs! Question is:  Can I connect the audio from both a DVD drive and CD/R/RW directly to the 875P Neo mobo