Displaying different patterns on a label

Hi,
I want to display different patterns on a label component , like label with mesh or lable with lines passing diagonally. Is there any way to draw these patterns on a label
Thanks

We dont want to draw
anything on label. we just need to display different
desings on labels
...and the way to display different designs on the label is to draw on it. However, you should not override the paint method, you should override the paintComponent method (assuming that you are using Swing rather than AWT, which seems to be a fair assumption since you are posting this in the Swing forum).
Here is a very simple example of one way of doing this. See how the paintComponent method is overridden to draw horizontal lines on the label. Maybe this can give you some ideas.
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
public class HorizontalLinesLabel extends JLabel {
    private static int GRID_SPACE = 7;
    public HorizontalLinesLabel(String s) {
        super(s);
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        int h = getHeight();
        int w = getWidth();
        for( int y = GRID_SPACE; y < h; y += GRID_SPACE ) {
            g.drawLine(0, y, w, y);
}

Similar Messages

  • Page Displays Different in Firefox

    I am new to web site development and new to Dreamweaver.  When I display the webpage in FireFox 3.6.3, the header picture shows below the logo on the left.  It displays fine in IE.  BTW, the font choice is not mine I tried to talk the person out of it.
    http://www.mulberrylanehillsdale.com/sample3.html

    You answered to the most little part of my comment (there was a suggestion for paged medias or for rendering on smaller displays, but this was not so critical, you should have seen it).
    The main point was about font smooting, that you have enabled in ALL browsers, EXCEPT Firefox on Windows.
    And this gives really a bad/unfair view of what is really Firefox on Windows.
    If one wanted to test a page for Firefox on Windows, he would certainly expect to see what he really sees on its PC, now most often with a flat panel display with pixel precision, but certainly not the non-smoothed rendering which is only for those users that have CRT displays.
    That's why I was not suggesting  really an expansion of the number of browsers. But:
    - if you have renderings for some browsers WITHOUT font smoothing, offer it on ALL browsers, to be fair
    - if you also have renderings for some browsers WITH font smoothing, offer it on ALL browsers, to be fair
    In other words, it should be a generic display option, that is independant of the browsers tested, and that should be selected by your users in their preferences, according to their own preferences: if a browser only supports one option (with or without font smooting), just display this version, otherwise, use the selected option on all compared browsers.
    And you will then see that most of your users are already preferring the pages rendered on any browser with the font smoothing enabled.
    Don't use the Microsoft's ClearType option, which uses subpixel precision, as it would require you to manage at least two versions: for display on your site with a RGB panel, or with a BGR panel : subpixel order would then have to be selected, adding two other versions of the same page for the same browser on the same OS... Instead just offer the pixel-level only smoothing, where smoothing applied equally to all R/G/B subpixel color planes, so that a black font on white background will be smoothed only using only "white-gray-black" full pixels without position-dependant colors).
    Side notes:
    For the long term, note that subpixel precision will be deprecated/obsoleted sooner or later (including on small display panels such as mobile phones, that will be the first to offer the highest pixel densities):
    It should be up to the display panel technology to map internally the standard sRGB colors (computed by softwares or in digital image formats or in web browsers and other computer GUI interfaces) to actual subpixels in a pixel (which may have different patterns, different coverage, different relative positions, possibly also 4 subpixels or more, just like with new Yamaha HDTV sets that use a non rectangular grid for the arrangement of subpixels, and that also use an additional yellow or white subpixel). Subpixel rendering technologies in software will also be deprecated because the display panel technologies will continue to improve to offer higher pixel densities, up to a level where the position of subpixels will not be noticeable : only the full-pixel smoothing will remain as it will reduce a lot the CPU/GPU cost of rendering and will be much faster to compute, using also less memory for finally the same resolution.
    Subpixel smoothing anyway is patented, and only a temporary "cheap" solution that can be implemented in CPU/GPU software, as long as flat panels don't have a higher pixel density (i.e. measured in full pixels per inch, not in colored subpixels per inch). These subpixel software technologies are in fact a nocive brake to allow the technical evolution of hardware display panels (the existing panels using rectangular R/G/B girds arranged in parallel vertical stripes have a poor color gamut, and display noisy color artefacts, as demonstrated by ClearType). The true evolution will not be in software but in hardware display panels, that will still benefit a lot from full-pixel font-smoothing only:
    - for example, the existing software subpixel artificially smoothing triples the horizontal resolution (but effectively only doubles the apparent horizontal resolution, due to correction of color artefacts), but do not increase the vertical resolution which remains poor. This gives an anisotropic result, which is desastrous for natural photographs or videos).
    - newer hardware subpixels arrangements (such as Yamaha's) can effectively double BOTH the horizontal and vertical resolution (and not just for text, but also for photos), using exactly the SAME subpixel density, and will produce a much better isotropic result without color artefacts (fair for high-fidelity colors and smooting of photos and video): this means similar costs of production of these panels, that should already be available in shops today and on notebooks, if this was only compatible with subpixel rendering softwares such as Microsoft's ClearType. and for now, we can't still have them on cheap PCs and notebooks, but only on the most expensive HDTV sets (notably the largest 1080p screens, whose size is more than 35 inches): note that these HDTV sets are also used for computer display (notably as a secondary "theater" screen for playing digital videos on online VOD contents) and for them the subpixel font-smoothing softwares have absolutely no use, only full-pixel smoothing will work correctly.

  • Embedded fonts display differently in mx and spark

    Hi there,
    My apologies if this is an known issue but I have not been able to find any posts describing this problem. As the title of the discussion describes the problem I see is that when embedding the same font for spark and mx components they display differently to the point of making the application look sloppy. I created a small app to illustrate the problem:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
        minWidth="955" minHeight="600"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @font-face
    src:url("arial.ttf");
    fontFamily: arialCFF;
    embedAsCFF: true;
    @font-face {
    src:url("arial.ttf");
    fontFamily: arialNoCFF;
    embedAsCFF: false;
    advancedAntiAliasing: false;
    s|Label
    fontFamily: arialCFF;
    fontSize: 20px;
    mx|Label
    fontFamily: arialNoCFF;
    fontSize: 20px;
    </fx:Style>
        <s:layout>
            <s:VerticalLayout
                paddingLeft="10"
                paddingTop="10"/>
        </s:layout>
        <s:Label text="This is a label that uses spark"/>
        <mx:Label text="This is a label that uses mx"/>
    </s:Application>
    I used the Arial.ttf font I found in my mac, though I have also tried with courier new and even the myriad web pro provided with an example in the SDK. Also I have tried with SDKs 4.1, 4.5 and 4.5.1. I have played with the value of advancedAniAliasing as well. Regardless of the combination I will still see differences such as this:
    Is this a known issue? Any solutions at hand?
    Thanks in advance for the help!!

    Hi there,
    Thanks for the quick reply. I was able to make fonts display correctly after hacking the display of some components (mx.controls.FormItem for example) however I did notice a whole buch of runtime warnings that showed up as a result of the workaround such as:
    warning: incompatible embedded font 'arialCFFFont' specified for mx.core::UITextFormat. This component requires that the embedded font be declared with embedAsCFF=false.
    TextFieldAutomationHelper:captureSelection() - 'selectionBeginIndex' is not implemented in FTETextField.
    And in some cases for components I do not even use:
    warning: incompatible embedded font 'arialCFFFont' specified for mx.controls::TextInput (TextInput1967) . This component requires that the embedded font be declared with embedAsCFF=false.
    Any ideas on how to avoid this noise or do we have to live with this?

  • Illustrator CS4 and my drop down menu displaying different typefaces is no longer displaying font preview.

    I am using Illustrator CS4 and my drop down menu displaying different typefaces is no longer showing all of them, just blank spaces where they would be...that is unless I put my cursor over it and I can then see the typeface. This is more of a nuisance than anything and didn't happen until I updates OS X to Yosemite. I currently am operating OS X  Yosemetie 10.10.2
    I have attached a screen shot. You can see that the font highlighted as the cursor is over it I can see the preview...but one I move the cursor it appears like all the others in the list and is blank.
    HELP!

    Solved using this previous users had the same issue; Font previews not appearing correctly in the character window after upgrading to Yosemite

  • Fost Displaying Differently in Different Browsers on Same Computer

    Why would a font display differently on the web page depending on the browser? If the font is installed on the computer (a Mac), isn't it available to all browsers?
    The specific problem I am having is with Palatino shadow. (The shadow is important, as it increases the contrast of the text against the image background.) The shadow shows up in Safari but not in Firefox.
    Why would this be?

    Firefox doesn't do shadows in the current version.

  • How to display different icon within WDA alv table base on row data ?

    Hi,
    is that possible to display different icon for every row within ALV table depending on the row data ?
    for instance if the status 'S' display ~Icon/SuccessMessage and 'E' display ~Icon/ErrorMessage ?
    because base on this code below i only can set 1 icon for the whole row data.
    LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'ICO'.
            CREATE OBJECT lr_caption.
               lr_caption->set_image_source( value = '~Icon/SuccessMessage').
               <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    Thank you in advance.
    Fernand

    Hello,
    Yes it is possible to display different images based on data.
    For that what you can do is create one attribute 'STATUS' of type string in context node which you are mapping to ALV.
    And fill that attribute with the path to image based on your requirement like for status 'S' set the attribute to ~Icon/SuccessMessage and if status is 'E', set it to ~Icon/ErrorMessage at runtime.
    Now in the settings for ALV use the following code:
    * Display icon in column seatsocc
      DATA: lr_column TYPE REF TO cl_salv_wd_column,
            lr_image TYPE REF TO cl_salv_wd_uie_image,
            lv_icon TYPE string.
      lr_column = lv_model->if_salv_wd_column_settings~get_column( 'SEATSOCC' ).
      CREATE OBJECT lr_image.
      lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).
    in the above code, column 'SEATSOCC' will be displayed as an icon.
    Sample code to fill the attribute 'STATUS'
    LOOP AT lt_flights INTO ls_flight.
        lv_seatsfree = ls_flight-seatsmax - ls_flight-seatsocc.
        IF lv_seatsfree = 0.
          ls_flight-status = 'ICON_RED_LIGHT'.
        ELSEIF lv_seatsfree <= 50.
          ls_flight-status = 'ICON_YELLOW_LIGHT'.
        ELSE.
          ls_flight-status = 'ICON_GREEN_LIGHT'.
        ENDIF.
        MODIFY lt_flights FROM ls_flight.
      ENDLOOP.
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 25, 2010 12:02 PM

  • How to display different Time Statement forms in ITS service PZ04

    Hi all,
    I am working on a underlyinge R/3 4.7 system and are working with standalone ITS and ESS 50.4. I am posting this question to find out if any of you has experience with my problem.
    The business wishes to use the ITS transation PZ04 standard and wish to be able to display different Time Statement forms in the transaction through customized variants for the report(RPTEDT00) that the PZ04 transaction executes. In the IMG it is posted that one variant has to be created called HRESS_TEDT00 and this works, but restricts the PZ04 transaction to always be called with this variant and therebye the same Time Statement form every time.
    I then by debugging found that the underlying ABAP code processed from SAP standard has a variable VARIANT that is hardcode to = HRESS_TEDT00.
    The question is: Is there anyway to setup the PZ04 transaction so that it can be dynamic decided which variant should be used, f.ex. from persons subarea from infotype 0001?
    Looking forward to here if anybody can help.
    Regards,
    Allan Brauer

    hi allan,
    cud u plz help me how to sort out this problem actually in mu company the same scenario is here need to be display pe51 form instead of standard hrforms.....
    plz help me how will i replace this "hrforms with pe51"..

  • PDFs display differently in Internet Explorer 9 versus FireFox

    We use Adobe Reader X in all cases (10.4.1)
    On old computer, we have a website we go to using Internet Explorer (version 8.x on XP) where we ope/save & print to a PDF file. The information on the PDF prints vaules in a certain order - for example:   A,B, C    --works great--this is what we want it to do.
    We buy a new computer, Windows 7 with IE9, and the PDF displays with the same values in this order:  C,B, A  -   not good, do not want that.
    We try FireFox on the new computer  -- works great --just like it did on the old computer.
    What setting in IE9 is causing this PDF to display differently than in FireFox (or IE8)?
    UPDATE:  We did load IE8 on Windows 7 (by uninstalling IE9) and the PDF works fine --so it's not just something unique to FireFox. IE9 is displaying information in this PDF differently--why?

    Add/update these params in your web.xml and redeploy so the style class names are not optimized and client debugging is easier.
    <context-param>
        <param-name>org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT</param-name>
        <param-value>true</param-value>
      </context-param>
      <context-param>
        <param-name>org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION</param-name>
        <param-value>true</param-value>
      </context-param>

  • How to make a form dynamic so that it displays different logos at runtime

    I am working on some assignment wherein I would like to make a form dynamic so that in it's designated image holder it displays different logos/pictures at run time? First of all is there such a possibility?? I am still very new to this forum and also trying to understand the logic/bindings/heirarchy etc. in LCD. Any input would be highly appreciated.
    Thanks in advance

    LC 7 or 8 does not help load logs at runtime. However you can associate all your logs at design time and control their visibility property based on the events. This may help fulfill the requirements you have to an extent however adding number of images at design time will increase the size of the template.

  • PDF file displays different number of text blocks in Acrobat Pro CC 2014 and CS6 versions

    Hi,
    I've inherited a file at work that displays different numbers of text blocks, depending on the version of Acrobat Pro used to view the file. Here's the specific issue:
    As viewed in CC 2014:
    "Chapter 1 - Chapter One Title": Appears as two text blocks -- one for "Chapter 1 - " and one for "Chapter One Title"
    As viewed in CS 6:
    "Chapter 1 - Chapter One Title": Appears as a single text block -- "Chapter 1 - Chapter One Title"
    This occurs only with regard to single-digit chapter numbers that are whole numbers. So:
    Chapter 1, Chapter 5, and Chapter 7 entries appear as two blocks in CC 2014, one block in CS6.
    Chapter 2.0, Chapter 6.1, Chapter 10, entries appear in single blocks in both CC 2014 and CS6.
    The PDF file was created -- I believe -- through the save-to-PDF feature in Word 2010.
    Any idea what's happening here?
    Thanks.
    David

    First of all, there is no such thing as Acrobat CS6 or Acrobat CC 2014. We assume you are referring to Acrobat X and Acrobat XI respectively.
    Secondly, how are you determining how many text blocks are in the PDF file? By use of the text touchup/edit function in Acrobat? If so, how this edit function displays text doesn't necessarily correspond to the actually underlying text fragments in the PDF file. In fact, sometimes it combines fragments based on heuristics. Those heuristics have varied with different version of Acrobat.
    PDF as a file format doesn't know the context of the graphical objects such as text. There is no concept of a line, a sentence, a paragraph, a column, etc. in terms of text. Runs of text are context-insensitive. You will get “breaks” when switching between regular and italics or when unusual paragraph justification is involved.
    Is the actual problem in trying to edit the text or something else?
    If you post a file, and indicate what text we should look at, we can confirm what is actually going on in your file.
              - Dov

  • Displaying different levels of the same hierarchy in the different columns

    I have a parent child hierarchy and wish to display different levels of the hierarchy in different columns of the resultset eg
    level 1 level 2
    Europe UK
    Europe France
    N America US
    N America Canada
    However writing MDX like the below
    select
    {} on 0,
    ([Geo].[level 1],[Geo].Level 2] on 1
    from cube
    results in the error "The [Geo] hierarchy is used more than once in the crossjoin
    How can I get around this??

    Hi,
    You can make use of CrossJoin function in MDX, I give a sample MDX based on the AdventureWorks database:
    select {[Measures].[Reseller Sales Amount]} on 0,
    crossjoin({[Sales Territory].[Sales Territory Group].[Sales Territory Group].members},{[Sales Territory].[Sales Territory Country].[Sales Territory Country].members}) on 1
    from [Adventure Works]
    After execut the MDX you will get the result like this:
    Reseller Sales Amount
    Europe
    France
    $4,607,537.94
    Europe
    Germany
    $1,983,988.04
    Europe
    United Kingdom
    $4,279,008.83
    NA
    NA
    (null)
    North America
    Canada
    $14,377,925.60
    North America
    United States
    $53,607,801.21
    Pacific
    Australia
    $1,594,335.38
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • I have just intalled PSElements 12 on a new PC with windows 8.1. It installed ok but when I open it up it displays different than on my windows 7 PC. The buttons and text are tiny and almosy impossible to see even when I drag it to full screen. How do I a

    I have just intalled PSElements 12 on a new PC with windows 8.1. It installed ok but when I open it up it displays different than on my windows 7 PC. The buttons and text are tiny and almosy impossible to see even when I drag it to full screen. How do I adjust it to look normal?

    Hi Paul ,
    It could be a compatibility issue as well as Acrobat 8 is an older version.
    Do you get any error message while registering for the product?
    Try repairing it and once and also check for updates as well.
    Is it happening with all the word files or any specific one'?
    Regards
    Sukrit Dhingra
    Acrobat 8 and Windows 7 Don't Work

  • Image layouts display differently in Safari than in Explorer

    I have noticed that web page images display differently in Safari than in Explorer on a PC. On a PC, the web page may display three images side by side. In Safari, I might get two images side by side and the theid image below. Is there any correction for this? Thanks.
    Norb

    #sidebar_1 a:vistied {
    color:#000;
    is stating that all visited links in the #sidebar_1 div to be black. Are you saying that all visited links are black, outside the sidebar_1 div?
    Jim

  • Imported swfs display different every time

    Hello -
    I have tried importing swfs, and each time it displays different when published. The first time, it resized and could be seen completely within the window. The second time, it did not resize so only the top left of the image could be seen. The third, time it sort of resized, but is still cut off on the bottom. I inserted the same swf file the same way each time, so I'm not sure what affects the way it displays when published. I'm using the trial version of Presenter version 7.0.7 Build 7746. The swfs were created in Captivate 5.0, and I'm using Office/PowerPoint 2010. Below are examples of what each looks like after the publish. Does anyone know how I can control how the swf will display once published?
    Thanks!
    Katherine

    Hello -
    I think it has to do with resizing the swf once it is imported. I resized it first by widening it so it went the entire width of the page - the second time I believe I did the same thing and got the larger image. Then I tried various ways of resizing and also not moving or resizing at all, and got these different results. It is not consistent, the same way of resizing did not result in the same output. Is it not possible to resize the imported swf - for example, resize so it takes up the entire slide? Below is a link to download the swf I'm using.
    http://mylearn.documentum.com/curriculumdevelopment/slide4.zip
    Thanks!
    Katherine

  • How to display different icon, for different node of jtree

    Hi All,
    How to display different icon, for different node of jtree

    you haven't responded to my last post here: [http://forums.sun.com/thread.jspa?threadID=5323190&messageID=10382676#10382676|http://forums.sun.com/thread.jspa?threadID=5323190&messageID=10382676#10382676]

Maybe you are looking for

  • Which type of text field should I use?

    I am having a problem selecting the best object to use to display and control text. If I use a TextArea component, I have problems controling it with code and I hate getting caught up in Hbox and VBox layout issues. Also, I cannot seem to generate a

  • Filed status group for Vendorn

    Dear All Iam posting an entry through transaction code F-42 by useing the posting Key 37 vendor debit and posting key 27 vendor credit. I want Profit center field in optional which was not their. This is the reason entry is not been posting because i

  • Why i can't download pages

    why Pages can't be download on Macbook Air OS X 10.8.5 and pages needs 10.9 when both systems had been updated recently ( >:-S) ... any other good word processor on the AppStore?

  • CTAS causes ORA-31061: XDB error: XML event error

    The query works, the CTAS fails: CREATE TABLE Moocows AS ERROR at line 1: ORA-31061: XDB error: XML event error ORA-19202: Error occurred in XML processing In line 1 of orastream: LPX-00245: extra data after end of document CREATE TABLE Moocows AS WI

  • DBMS_XMLSCHEMA.INPLACEEVOLVE or COPYEVOLVE procedures

    Does anyone have any experience with these? Currently in 10G we have to translate the entire table when we want to make any changes to the registered schema. We are hoping 11G is a bit more friendly. Is there a way to use these procedures similar to