How do you underline type in java

I am new to java and I can't seem to find a way to make type underline in a applet. do I add something to the g.string or is there a int. I need to use?

Java does not support underlining as a font property. In order to do this properly, you need to look at the Java 2D text capabilities, esp. the TextLayout and related classes.
Mitch Goldstein
Author, Hardcore JFC (Cambridge Univ Press)
[email protected]

Similar Messages

  • In iMessage how do you underline

    On my iPhone 5 using iOS 7.2 how do I underline in iMessage?

    Hi Ron Bird
    You can't actually underline in messages at the moment.  It does seem as though you can because sometimes it will underline text for you.  I find this is generally things that you're phone is picking up as potential appointments or meetings though.  Eg.  When I send a message asking if somene wants to "have drinks tonight".  Sometimes I'll find the words "drinks tonight" or just "tonight" will be underlined.
    Hope this helps.
    Lynz

  • How to check browser type using java.

    Hi,
    can anybody help me to check browser type using java.
    Weather it is IE or Mozilla or Opera .
    any class in java for such operation?
    vjoy

    can anybody help me to check browser type using
    java.
    Weather it is IE or Mozilla or Opera .
    any class in java for such operation?From where do you want to perform the check? An applet, application or web application?
    Kaj

  • How to encode primitive type  in JAVA

    who can give me some documents that clarify how to encode primitve type ,or directly clarify in your words. thanks!

    the rule is : 1 is encoded in binary string :
    0000 0000 0000 0000 0000 0000 0000 0001
    -1 is encoded in binary string:
    1111 1111 1111 1111 1111 1111 1111 1111

  • How do you program sprites in JAVA ?

    As far as I understand, a sprite is something you can move about without disturbing the background, because it is not paert of the frame buffer. But how do I write a code for it? Could someone please give me some hints?

    to extend Malo's definition, a sprite is more commonly referred to as an "image that moves"-- not to be confused with animated images such as GIFs. the standard java library doesn't provide a Sprite object, but you can easily create one yourself...
    public class Sprite {
         Image img;
         int x,y;
         public Sprite(Image img) {
              this(img,0,0);
         public Sprite(Image img,int x,int y) {
              this.img = img;
              this.x = x;
              this.y = y;
         public void move(int x,int y) {
              this.x+=x;
              this.y+=y;
         public void moveTo(int x,int y) {
              this.x = x;
              this.y = y;
         public void paint(Graphics g) {
              g.drawImage(img,x,y);
    }something like that..

  • How do you access SENS in JAVA

    Hi, I would like to know how to access SENS (System Event Notification Service) in JAVA, any hints?

    You don't need the int declaration if it's already defined earlier in scope. If you're translating a large amount of code (not just this little piece), then that would appear to be the case (that i was already declared) as C also requires this, just as Java does.

  • How do you translate this in java?

    this is supposedly a c statement
    how is this translated in java?
    i mean, is this even possible?
    for (sum=0,i=0, j = 0; i < 10; i++, j+=2)
         sum += i+j;

    You don't need the int declaration if it's already defined earlier in scope. If you're translating a large amount of code (not just this little piece), then that would appear to be the case (that i was already declared) as C also requires this, just as Java does.

  • How do you compile "type body" objects that are invalid?

    We just completed a few application upgrades and now the objects catindexmethods and textindexmethods are invalid. These are part of our intermedia install but haven't started using it yet. How to I recompile these objects to be valid again?

    Did a little deeper and you shall find it:
    alter type xxx compile body;

  • How do you begin learning about Java?

    Hi. I'm new to Java. I began taking a class at the local Community college where I live. I'm in my second term. It's a lot harder than the first. I'm not sure if I still understand the basics. I've written in COBOL, RPG I,II,III&IV, C, C++, C#, Pascal, Fortran, and Basic...along with a few other languages, but I find Java the hardest one to understand and program in.
    Anyone out there got any advise as to how to begin?
    I still feel very lost.

    I am still learning myself. I have dabbled in programming since about 1976 when BASIC was available on the TRS-80 Model 1 but never did anything serious.
    Start with the Java Tutorials at http://java.sun.com/docs/books/tutorial then look at other tutorials. There are some here:
    <ul><li>Java Beginner Tutorial by
         Srini Appikatla</li>
    <ul><li>[http://www.javabeginner.com/]</li>
    </ul>
    </ul>
    <ul><li>Java Advanced Tutorials on
         ipodlot.com</li>
    <ul><li>[http://www.ipodlot.com/javalearner/test/advanced.htm]</li>
    </ul>
    </ul>
    I haven't worked through all of them but they look good so far.
    Next, buy some books. I like "The Java Tutorial" Forth Edition. Yes, it is the same as the web site but it is easy to read sequencially. It doesn't cost much, used on Amazon.
    Finally, actually write some code. It doesn't have to do much. Just play around. As you learn each new thing, try it out. It makes a big difference.

  • How do you underline a drop cap so that subsequent text wraps around it?

    I've found a PDF online where the designer has used large drop caps on a number of occasions that are underlined.
    Obviously this isn't technically difficult, I can add an underline in the Character panel, but the underline appears over the top of the line of text below.
    In the case of the original example, not only does the line of text below appear below the underline on the drop cap, the text adjacent to the right of the drop cap is perfectly lined up with the bottom of both the drop-capped letter and the underline, as if everything is set on the baseline. How is this achieved so acurately?

    This is possible in Indesign byu using the paragraph styles.
    You can setup a paragraph style to add a drop cap using a charachter style ( Image 1)
    and then add the underline option in the charachter style used for the dropcap and change the ofset accordingly for the underline option ( image 2)

  • How do you increase type size in menu bars and panels?

    I recently abandoned my Mac Pro 1,1 for a shiny new Mac Pro cylinder running Mavericks 10.9.5. I have paired it with an LG 27" IPS display. The reason I am using the LG is because I was frustrated that Apple pays absolutely no attention to the pleas of their pro users for a non-reflective display.
    And now I find that the type in the menu bars and panels is so small that it literally causes me eyestrain - and that I can't increase the type size. I am older (62), but I still need to use my Mac to survive. Unfortunately, though, it appears that Apple designers have again ignored the needs of their pro users -  in this case, older ones.
    I have been a graphic designer and a producer of technical and marketing publications for over 35 years, and I appreciate good-looking design -  but the real measure of design is usability. Even great-looking design must be user friendly.
    So now I am wondering if Apple interface designers are amateurs, or if they just don't give a @#$% about their users.
    Did I miss it? Is their a way to increase type size in menu bars, etc.?

    Did I miss it?
    Yes.
    System preferences > Displays > Resolution ...
    choose "Scaled" and pick an alternate resolution.
    When you do this, text will be drawn as if your screen were actually set to that revolution, but graphics will be drawn full-scale at the native resolution.
    This feature was invented for Retina Displays, and has finally been made available for additional displays.

  • Baseline grid? How do you make type line up across facing pages?

    I'm laying out a book in Pages, and I have it set up as 12.5-point type on 15-point line spacing, exactly. The margin at the top and bottom of both pages is 0.9 inches. There is a header and a footer set on each page at 0.4 inches. But occasionally, one page will have 32 lines of body type on it, and the facing page will have 31 lines. No change in type size or leading on either page.
    When I saw in the Pages user manual that you could specify the line spacing "exactly," I thought that was the solution. But still, occasionally, I will get two facing pages do not line up exactly, one still has 32 lines and the other 31.
    I thought, hmm, what if I change the leading to 14.9-point on the 31-line page just to see what happens. Weirdly enough, the spacing does tighten up, way more than enough to fit that 32nd line onto the page, but the type does not flow back in from the next page. It just leaves a bigger space there than before, and still 31 lines. I'm stumped.
    Is there any kind of baseline grid feature in Pages that might cure this? I didn't see anything like that in the user manual, but could there be some kind of equivalent, or a workaround? (Well, besides using Quark or InDesign?) It would look so much better if it didn't have the occasional blank line at the bottom of a page.
    Thanks for any advice.

    Thanks much, Walt and Peter, you were both right. I rethought my whole document layout, starting with the idea that I would put every line of 12-point body type on a 14-point slug. So I made the page length a multiple of 14-point lines. I also had some 16-point chapter titles that I formatted to be on 28-point slugs. I was not consistent enough in my chapter headline formatting before. And I tweaked my top and bottom margins so the length of the type area on the page would accommodate 37 lines of type. Once I had this setup, I was confident it would work. It did. For a while. Then I ran into a page that had only 36 lines, not 37. Hmmm. Yes, that's where unchecking the "prevent widow and orphan lines" box paid off. It allowed a line to flow back from the next page and fill in the 37th slug.
    It doesn't have the elegance of setting up a baseline grid and locking the type to it, but it works. Thanks again for your assistance, guys.

  • HOW DO YOU FORM TYPE TO A SHAPE?

    I have a logo design that requires the type to fit is a shape of a pennant. I am trying to avoid doing the manually with each individual point. I want the base line and the Cap-height to for within the shape. Any help is appreciated.

    > I think it's because I didn't fill the object that I place on top.
    Fill/stroke of the path being used to define the Envelope doesn't matter.
    The problem is the behavior of the Illustrator's Envelopes. As soon as Illustrator creates an Envelope, the handles of its anchorPoints are extended from the beginning; even on Envelopes with no curved segments. That becomes a stumbling block when you then try to change the shape of the Envelope, because it's difficult to get the handles aligned correctly so as to *not* bend straight segments of the content.
    So if you create an Envelope by, for example, Make With Mesh, and then try to move the point of your rooftop, you have to deal with the extended handles problem. Simply retracting the handles does not serve, because that "sucks" the content toward that anchorPoint.
    If instead, you go ahead and first draw a path in the desired shape of the Envelope, and then create the Envelope via Make With Top Object, you still get the often infuriating automatically-extended handles. (They are there in the Envelope shown in my screen shot.) But because the Envelope was *created* already at the shape you want, you don't have to muck with them.
    Don't get me wrong; you just as often *want* Envelopes to begin with extended handles as not. The trouble is, Illustrator doesn't give you the choice.
    FreeHand's Envelopes do much better. It is a trivial matter to pre-define an Envelope in FreeHand which, when applied, will simply have retracted corner points.
    JET

  • How to Change Paper Type Using Java script

    HI ,
    We have a requirement , in which we have to change the paper type i.e. "A2" , "A3","A4" etc.  while printing using a JavaScript. I have written a code like this :
    xfa.form.form1.pageSet.Page1.medium.stock = "A2"; But this is not working. please help me out.
    Thanks,
    Bhaskar.

    That's the right object for choosing the page size at Design time. What event are you doing this on? Although you can change it in the form model, the form's page size is already determined from the template by the time you have a form to script against, so although you can change it via script after the fact in XFA, I don't believe it will have any impact. Even putting it on the layout ready event does not work.

  • How to change font type in java mail script?

    Hi,
    I wrote a bean shell script to send mail on particular event. I want mail message body text font style to be modified.
    Please provide help on this.
    Thanks,
    Saloni

    Hi Saloni ,
    You can add the text in the following way by using font tags for message body in your custom mail.
    Message msg = new MimeMessage(session);
    MimeMultipart mp = new MimeMultipart();
    MimeBodyPart mbp1= new MimeBodyPart();
    String htmlText = "<b> This is formatted</b>"+
    "<font size =\"5\" face=\"arial\" >This paragraph is in Arial, size 5</font>";
    mbp1.setContent(htmlText,"text/html");
    mp.addBodyPart(mbp1);
    msg.setContent(mp);
    It worked for me. Let me know if you face any issue.
    Regards,
    Uday.

Maybe you are looking for

  • Read images from a jar file?

    Hello, I'm converting a 6i app to 10g. This app does a ton of read_image_file() calls to change GIF images on the screen based on user actions. In 6i the images are all stored on the local hard drive. The images are not icons for buttons, but images

  • Calling a BSP from ABAP with parameters

    Hi All, I am running a regular abap report in R/3 release 4.6C. This program calls a BSP using the FM Call_browser. Question: How can I pass parameters for my BSP program ? Thanks Marcelo

  • Speaking instead of typing a text message

    Does anyone know if there is an app available that will allow you to speak your text in text messaging?  I have seen speak to text apps. but they are all for email.  My old Droid phone had a mic icon on the keyboard so if I needed to send a text to s

  • My laptop locked after I don't use it for several minutes.

    Hi everyone, I have a really troublesome problem. My laptop is locked after I don't use it for several minutes. When I say locked, I mean it turns to where shows my account name and below it says locked. At first, I think it is cause by the Auto-lock

  • HT4623 recently installed apps can't access photos on my iPhone

    Operating Details: Device: iPhone 5 Carrier: Verizon iOS: 6.1.3 Goal: I'd like to update my profile picture on one of my Twitter accounts using an image stored on my iPhone in my Photos. Issue: When I try to edit a profile picture in any of the apps