String height

hi
I dont know whether this is the correct forum to ask my doubt.
i calculated the string width of a string with a font style,font size,name etc.
eg:
Font font = new Font(fontName, style, size);
JButton jButton = new JButton();
FontMetrics fontMetrics = jButton.getFontMetrics(font);
width = fontMetrics.stringWidth(inputString);
i also want to get the height of the string also.how can i get it.i want the height of the string only based on font name, style, size.
is there any method to find it.
plz help me.
rgds

FontMetrics.getHeight
FontMetrics.getMaxHeight

Similar Messages

  • Dynamically size movieclip to fit text's string height and width

    Hello,
    I am trying to dynamically size a movieclip to fit the size of a text's string height and width (This text is inside the movieclip)
    here is my code so far..
    var Font1_ = new Font1();
    var Format2:TextFormat = new TextFormat();
    Format2.size = 36;
    Format2.align = TextFormatAlign.CENTER;
    Format2.font = Font1_.fontName;
    var MessageBox:MovieClip = new MessageBoxMC();
    MessageBox.Text1.defaultTextFormat = Format2;
    MessageBox.Text1.embedFonts = true;
    MessageBox.Text1.antiAliasType = AntiAliasType.ADVANCED;
    MessageBox.Text1.wordWrap = true;
    MessageBox.Text1.width = 800;
    MessageBox.Text1.height = 400;
    MessageBox.Text1.textColor = 0xFFFFFF;
    MessageBox.Text1.cacheAsBitmap = true;
    MessageBox.Text1.mouseEnabled = false;
    MessageBox.Text1.text = String("Use the Arrow Buttons to move");
    MessageBox.width = MessageBox.Text1.width;
    MessageBox.height = MessageBox.Text1.height;
      MessageBox.x = 400;
      MessageBox.y = 200;
      addChild(MessageBox);
    this isn't working for me.. anyone know the best way to do this?
    I also want the text to be centered in the movieclip, with a border of around 2-4 pixels
    I am also not sure if i should be using text.length? any advice and input is greatly welcomed.
    thanks in advance!

    Essentially, you need to check for a change in .textWidth or .textHeight, which are different from .width and .height.
    This code works for me (assumes a background box called bg and a foreground text instance fg inside a moveclip and an X and Y bounds offset variable to say how far away you want the box from the text and a textFrameNudge to provide a tweak value).
         // Resize background box
         thisBox.bg.x = thisBox.fg.x - boundsOffsetX + textFrameNudge; // I'm using .4 as the tweak value for textFrameNudge
         thisBox.bg.y = thisBox.fg.y - boundsOffsetY;
         thisBox.bg.width = thisBox.fg.textWidth + boundsOffsetX*2 +textFrameNudge*thisBox.fg.getTextFormat().size;
         thisBox.bg.height = thisBox.fg.textHeight + boundsOffsetY*2;

  • Access Standard property(eg Fixed Height) of an iview in code

    Hi ,
    I have downloaded the standard URL iview's par(com.sap.portal.httpconnectivity.urliviews.par). I want to access the  property 'Fixed Height' in the code. The component profile of the par doesnt contain the above attribute(and many other standard attributes which we get to see in the property editor of the iView). Can somebody please help me in this regard.
    Regards,
    Prathamesh

    Hi,
    I would suggest you to use the PcmConstants.ASPECT_ADMINISTRATION for Constants.REQUESTED_ASPECT in environment.
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_ADMINISTRATION);
    env.put(Context.SECURITY_PRINCIPAL, request.getUser());
    InitialContext iCtx = null;
    String roleID = "pcd:portal_content/DanielContent/DanRole";
    try{
        iCtx = new InitialContext(env);
        PcmAdminBase adminBase =
                (PcmAdminBase) iCtx.lookup(roleID);
        IPcdAttribute attribute = (IPcdAttribute) adminBase.getPcdContext().getAttributes("").get("com.sap.portal.iview.Height");
    String height = attribute.get().toString();
    Greetings,
    Praveen Gudapati

  • Strange Behaviour setting column width & height programmatically

    I'm trying to set the height and width of an image by storing the image, height and width in the database at the row level.
    OATableBean table = (OATableBean)webBean.findIndexedChildRecursive("QuoteLinesRN");
    OAImageBean lineImageBean = (OAImageBean)table.findIndexedChildRecursive("ImageItem");
    //Next 4 lines set the image file name from the data in Segment1 - they work as expected
    FixedBoundValue imageDirectory = new FixedBoundValue(APPS_MEDIA_DIRECTORY);
    OADataBoundValueViewObject statusBinding = new OADataBoundValueViewObject(lineImageBean, "Segment1");
    ConcatBoundValue statusCBV = new ConcatBoundValue(new BoundValue[] {imageDirectory, statusBinding});
    lineImageBean.setAttributeValue(SOURCE_ATTR, statusCBV);
    //Now here is the funny part -
    OAMessageStyledTextBean heightBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("Segment2");
    OAMessageStyledTextBean widthBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("Segment3");
    String height = (String)heightBean.getValue(pageContext);
    String width = (String)widthBean.getValue(pageContext);
    lineImageBean.setHeight(height);
    //Setting the width doesn't do anything if I set the height. And the image displays miraculously at the dimensions set in the actual physical file itself, for both height and width.
    //The values I have in the table to get the height and width are completely irrelevant.
    //Except I need to make a string out of the OAMessageStyleTextBean or the value for height and width will be as I specify ie. if I instead use: String height = "300" the height will be 300.
    //But why is the height and width not using the values I specify in the table as Segment2 and Segment3?
    //Is it because I'm not explicity setting the same index when creating the OAMessageStyledTextBeans as I used for my OAImageBean?

    I found some issues.
    http://javafx-jira.kenai.com/browse/RT-24636
    http://javafx-jira.kenai.com/browse/RT-22728
    http://javafx-jira.kenai.com/browse/RT-23517
    On my mind, these are the same.

  • Dynamically set flash chart height?

    Hi,
    I have a flash chart that includes a selector that alters the query for the chart. Depending on what the user selects, the chart shows a different number of rows (this happens to be a stacked horizontal bar chart, but this could apply to any chart type). I would like to be able to dynamically set the chart height based on the number of rows the query returns. If I set it too small and the user makes a choice that returns a larger number of rows, the chart bars are compressed to the point where the labels are unreadable or omitted altogether. Conversely, if I set the height to a larger value and the user makes a selection that results in a small number of rows, the chart is overly extended and hard to read.
    I am able to calculate what I'd like the chart height to be using a page item and a before header process. But I can't figure out how to pass this value to AnyChart. I tried using an item substitution (e.g., &P7_CHART_HEIGHT.) as the value for the chart height on the Chart Attributes/Chart Settings page, but this attribute requires a non-zero numeric value. I tried to figure out if I could alter the chart XML, but could not figure out how to do it and I'm not sure item substitutions would be passed in the XML anyway.
    Is there a way to dynamically set the height attribute of a chart at page load time?
    Thanks,
    Mike

    Hi Mike,
    You can update the Region Source of your chart, replacing the substitution strings *#HEIGHT#* with the reference to your page item *&P7_CHART_HEIGHT.*. So your chart region source should then look something like the following(note that I've trimmed some lines for display purposes), and when the chart is run it will pick up your setting for the height, based upon the value returned from your Before Header process:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        codebase="#HOST_PROTOCOL#://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
        width="#WIDTH#"
        height="&P7_CHART_HEIGHT."
        id="#CHART_NAME#"
        align="top">
    <param name="movie" value="#IMAGE_PREFIX#flashchart/anychart_5/swf/...............................">
    <param name="quality" value="high">
    <param name="allowScriptAccess" value="sameDomain">
    <param name="allowNetworking" value="all">
    <param name="scale" value="noscale">
    <param name="wmode" value="transparent">
    <param name="FlashVars" value="initText=#FLASH_INIT#&xmlLoadingText=............................................">
    <embed src="#IMAGE_PREFIX#flashchart/anychart_5/.......................................
           quality="high"
           width="#WIDTH#"
           height="&P7_CHART_HEIGHT."
           name="#CHART_NAME#"
           scale="noscale"
           align=""
           allowScriptAccess="sameDomain"
           allowNetworking="all"
           type="application/x-shockwave-flash"
           pluginspage="#HOST_PROTOCOL#://www.macromedia.com/go/getflashplayer"
           wmode="transparent"
           FlashVars="initText=#FLASH_INIT#&xmlLoadingText=#FLASH_................................................">
    </embed>
    </object>
    #CHART_REFRESH#
    {code}
    I hope this helps.
    Regards,
    Hilary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Wiki whitelist.plist not working here's the script and steps taken

    1. whitelist.plist created according to instructions in wiki admin manual.
    2. file placed in: /Library/Application Support/Apple/WikiServer/
    3. File permissions set to allow _teamsserver access like other files in directory.
    4. Webserver restarted.
    5. Attempt to add <head> tag to wiki fails. Code is stripped out after save.
    6. Has anyone got this working? I can't find any syntax errors in the file and I've tried the suggestion from another post to place the file in: /etc/wikid
    Here's the contents of whitelist.plist
    I don't know what else I can do to make it work. Any help is appreciated.
    I've pasted the code below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>protocols</key>
    <array>
    <string>file</string>
    <string>afp</string>
    <string>feed</string>
    <string>feeds</string>
    <string>fax</string>
    <string>ftp</string>
    <string>gopher</string>
    <string>http</string>
    <string>https</string>
    <string>itms</string>
    <string>itpc</string>
    <string>ldap</string>
    <string>mailto</string>
    <string>news</string>
    <string>nfs</string>
    <string>nntp</string>
    <string>rdar</string>
    <string>rtsp</string>
    <string>sip</string>
    <string>sips</string>
    <string>sftp</string>
    <string>smb</string>
    <string>ssh</string>
    <string>svn</string>
    <string>svn+ssh</string>
    <string>tel</string>
    <string>telnet</string>
    <string>vnc</string>
    <string>webcal</string>
    <string>xmpp</string>
    </array>
    <key>styles</key>
    <array>
    <string>font-style</string>
    <string>font-weight</string>
    <string>text-decoration</string>
    </array>
    <key>tags</key>
    <dict>
    <key>all</key>
    <array>
    <string>style</string>
    <string>class</string>
    <string>title</string>
    </array>
    <key>a</key>
    <array>
    <string>href</string>
    <string>name</string>
    <string>rel</string>
    </array>
    <key>blockquote</key>
    <array>
    <string>cite</string>
    </array>
    <key>body</key>
    <array/>
    <key>br</key>
    <array/>
    <key>caption</key>
    <array/>
    <key>dd</key>
    <array/>
    <key>div</key>
    <array/>
    <key>dl</key>
    <array/>
    <key>dt</key>
    <array/>
    <key>em</key>
    <array/>
    <key>h1</key>
    <array/>
    <key>h2</key>
    <array/>
    <key>h3</key>
    <array/>
    <key>h4</key>
    <array/>
    <key>h5</key>
    <array/>
    <key>h6</key>
    <array/>
    <key>head</key>
    <array>
    <string>title</string>
    <string>base</string>
    <string>link</string>
    <string>meta</string>
    </array>
    <key>html</key>
    <array/>
    <key>img</key>
    <array>
    <string>src</string>
    <string>alt</string>
    <string>name</string>
    <string>width</string>
    <string>height</string>
    <string>longdesc</string>
    </array>
    <key>li</key>
    <array/>
    <key>node</key>
    <array/>
    <key>object</key>
    <array>
    <string>classid</string>
    <string>width</string>
    <string>height</string>
    <string>codebase</string>
    </array>
    <key>ol</key>
    <array/>
    <key>p</key>
    <array/>
    <key>param</key>
    <array>
    <string>name</string>
    <string>value</string>
    </array>
    <key>pre</key>
    <array/>
    <key>q</key>
    <array>
    <string>cite</string>
    </array>
    <key>span</key>
    <array/>
    <key>strong</key>
    <array/>
    <key>table</key>
    <array/>
    <key>tbody</key>
    <array/>
    <key>td</key>
    <array>
    <string>colspan</string>
    <string>rowspan</string>
    </array>
    <key>tfoot</key>
    <array/>
    <key>th</key>
    <array>
    <string>colspan</string>
    <string>rowspan</string>
    </array>
    <key>thead</key>
    <array/>
    <key>tr</key>
    <array/>
    <key>ul</key>
    <array/>
    </dict>
    </dict>
    </plist>

    Ok. Found some more stuff. It appears that, as of 10.6.2, you can't have this in your whitelist: :
    <key>protocols</key>
    <key>styles</key>
    What's missing? Even if you have nothing to add to an area you must have the array tags e.g.
    <key>protocols</key>
    <array/>
    <key>styles</key>
    <array/>
    The problem is that the Wiki just fails if there is any problem with your whitelist, with no warning. To see the fault you have to look in the console log. There you will see something like this, which indicates a faulty whitelist file:
    8/01/10 10:34:00 AM com.apple.wikid[4416] Traceback (most recent call last):
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/application/app.py", line 689, in run
    8/01/10 10:34:00 AM com.apple.wikid[4416] config.parseOptions()
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/application/app.py", line 669, in parseOptions
    8/01/10 10:34:00 AM com.apple.wikid[4416] usage.Options.parseOptions(self, options)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/python/usage.py", line 226, in parseOptions
    8/01/10 10:34:00 AM com.apple.wikid[4416] for (cmd, short, parser, doc) in self.subCommands:
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/application/app.py", line 679, in subCommands
    8/01/10 10:34:00 AM com.apple.wikid[4416] for plug in plugins:
    8/01/10 10:34:00 AM com.apple.wikid[4416] --- <exception caught here> ---
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/plugin.py", line 204, in getPlugins
    8/01/10 10:34:00 AM com.apple.wikid[4416] adapted = interface(plugin, None)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/zop e/interface/interface.py", line 625, in callconform
    8/01/10 10:34:00 AM com.apple.wikid[4416] return conform(self)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/plugin.py", line 68, in _conform_
    8/01/10 10:34:00 AM com.apple.wikid[4416] return self.load()
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/plugin.py", line 63, in load
    8/01/10 10:34:00 AM com.apple.wikid[4416] return namedAny(self.dropin.moduleName + '.' + self.name)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/python/reflect.py", line 462, in namedAny
    8/01/10 10:34:00 AM com.apple.wikid[4416] topLevelPackage = _importAndCheckStack(trialname)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/caldavd/lib/python/twisted/python/reflect.py", line 398, in _importAndCheckStack
    8/01/10 10:34:00 AM com.apple.wikid[4416] return _import_(importName)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/wikid/lib/python/twisted/plugins/wikid.py", line 9, in <module>
    8/01/10 10:34:00 AM com.apple.wikid[4416] from apple_utilities.tap import WikiServiceMaker
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/wikid/lib/python/apple_utilities/tap.py", line 25, in <module>
    8/01/10 10:34:00 AM com.apple.wikid[4416] from apple_utilities import SettingsManager, Authentication
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/wikid/lib/python/apple_utilities/SettingsManager.py", line 916, in <module>
    8/01/10 10:34:00 AM com.apple.wikid[4416] globalSettings = SettingsManager(defaultConfigFilePath)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/wikid/lib/python/apple_utilities/SettingsManager.py", line 151, in _init_
    8/01/10 10:34:00 AM com.apple.wikid[4416] whitelist = WhitelistContentFilter.WhitelistContentFilter(userWhitelistPath, self.data['wiki']['whitelist'])
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/usr/share/wikid/lib/python/apple_wlt/WhitelistContentFilter.py", line 120, in _init_
    8/01/10 10:34:00 AM com.apple.wikid[4416] systemPlist = plistlib.readPlist(systemWhitelistFileLoc)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plistli b.py", line 78, in readPlist
    8/01/10 10:34:00 AM com.apple.wikid[4416] rootObject = p.parse(pathOrFile)
    8/01/10 10:34:00 AM com.apple.wikid[4416] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plistli b.py", line 405, in parse
    8/01/10 10:34:00 AM com.apple.wikid[4416] parser.ParseFile(fileobj)
    Message was edited by: John Holley NZ

  • X-Position from a computed field in Datawindow

    Hi all
    I have a computed field in the DataWindow. This should fix CF are at the position X. The width and the height are taken out of the data in the DB and is always different.
    Now is the CF are always fixed on X and the width goes to the left.
    example:
    x = 2600
    Width = 500
    The CF is then positioned so that it is not related to the width of the X position. So always dynamically to each set.
    How can I use the expression for Programming.

    Hi,
    Is this the effect what you are looking for?
    Below is the export of a datawindow. For the default x-position and width of the CF I had taken 800 for both; which might be confusing.
    And the columns you can make invisible or hidden if you want to.
    The expressions for the CF are.
    x="800~t800 + 800 -  width " y="40" height="80~t height " width="800~t width "
    The width and height in the expressions are the column names that might have been stored in the database.
    It is a 12.6 export; save it into a text file.
    If you are using 12.5 just change release to 12.5 on the second line and try to import the file.
    For older versions next to the release line you might have to delete some properties that didn't exist yet in that version for example the gradients. Importing will give errors and the position of the
    error property. It can be a bit tedious to find and delete them.
    One imported then view it in run-time.
    $PBExportHeader$d_pos.srd
    release 12.6;
    datawindow(units=0 timer_interval=0 color=1073741824 brushmode=0 transparency=0 gradient.angle=0 gradient.color=8421504 gradient.focus=0 gradient.repetition.count=0 gradient.repetition.length=100 gradient.repetition.mode=0 gradient.scale=100 gradient.spread=100 gradient.transparency=0 picture.blur=0 picture.clip.bottom=0 picture.clip.left=0 picture.clip.right=0 picture.clip.top=0 picture.mode=0 picture.scale.x=100 picture.scale.y=100 picture.transparency=0 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes print.background=no print.preview.background=no print.preview.outline=yes hidegrayline=no showbackcoloronxp=no picture.file="" )
    header(height=72 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
    summary(height=0 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
    footer(height=0 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
    detail(height=260 color="536870912" transparency="0" gradient.color="8421504" gradient.transparency="0" gradient.angle="0" brushmode="0" gradient.repetition.mode="0" gradient.repetition.count="0" gradient.repetition.length="100" gradient.focus="0" gradient.scale="100" gradient.spread="100" )
    table(column=(type=long updatewhereclause=yes name=rownr dbname="rownr" )
    column=(type=long updatewhereclause=yes name=width dbname="width" )
    column=(type=long updatewhereclause=yes name=height dbname="height" )
    data( 1, 800, 80, 2, 400, 80, 3, 400, 160, 4, 200, 160,)
    text(band=header alignment="2" text="Rownr" border="0" color="33554432" x="5" y="4" height="64" width="219" html.valueishtml="0"  name=rownr_t visible="1"  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    text(band=header alignment="2" text="Width" border="0" color="33554432" x="229" y="4" height="64" width="219" html.valueishtml="0"  name=width_t visible="1"  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    text(band=header alignment="2" text="Height" border="0" color="33554432" x="453" y="4" height="64" width="219" html.valueishtml="0"  name=height_t visible="1"  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    column(band=detail id=1 alignment="1" tabsequence=10 border="0" color="33554432" x="5" y="4" height="76" width="219" format="[general]" html.valueishtml="0"  name=rownr visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    column(band=detail id=2 alignment="1" tabsequence=20 border="0" color="33554432" x="229" y="4" height="76" width="219" format="[general]" html.valueishtml="0"  name=width visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    column(band=detail id=3 alignment="1" tabsequence=30 border="0" color="33554432" x="453" y="4" height="76" width="219" format="[general]" html.valueishtml="0"  name=height visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.autohscroll=yes  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    compute(band=detail alignment="1" expression="string(width) + ~" | ~" + string(height) "border="0" color="33554432" x="800~t800 + 800 -  width " y="40" height="80~t height " width="800~t width " format="[GENERAL]" html.valueishtml="0"  name=compute_1 visible="1"  font.face="Tahoma" font.height="-10" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="12639424" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
    htmltable(border="1" )
    htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" )
    xhtmlgen() cssgen(sessionspecific="0" )
    xmlgen(inline="0" )
    xsltgen()
    jsgen()
    export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
    import.xml()
    export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
    export.xhtml()

  • How do I embed YouTube or Vimeo video in an apple mail message

    Is there an easy  way to embed YouTube or Vimeo video in an apple mail message?
    I've tried using command+i (same with share feature) on a YouTube page ... looks great except I get missing plugin error on video.
    I'm up to date on Flash plugin, running Safari 6, OS X 10.8. No old Flash files in the internet library.
    Any help is appreciated!

    There's an HTML validator built in to the editor and it will, by default, throw out all but the simplest HTML tags.
    The Apple document, Mac OS  X Server, Wiki Server Administration V 10.6 explains all the gruesome details. But here's the solution that I use:
    Change to the Wiki Server's directory by using
    cd /Library/Application\ Support/Apple/WikiServer
    If it doesn't exist, create a file called whitelist.plist:
    sudo touch whitelist.plist
    The file will be owned by root and all members of the _teamserver group. The latter is required for the Wiki service to have access.
    Then edit the file with any appropriate editor -- I like vi:
    sudo vi whitelist.plist
    The file needs to have very specific formatting. This one should get your YouTube embedded HTML working:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>protocols</key>
    <array>
    <string>scp</string>
    </array>
    <key>styles</key>
    <array>
    <string>font-size</string>
    </array>
    <key>tags</key>
    <dict>
    <key>object</key>
    <array>
    <string>width</string>
    <string>height</string>
    </array>
    <key>param</key>
    <array>
    <string>name</string>
    <string>value</string>
    </array>
    <key>embed</key>
    <array>
    <string>src</string>
    <string>type</string>
    <string>width</string>
    <string>height</string>
    </array>
    <key>script</key>
    <array>
    <string></string>
    </array>
    <key>hr</key>
    <array>
    <string></string>
    </array>
    </dict>
    </dict>
    </plist>
    After making changes or additions, save and close the whitelist.plist file then restart the Web service using the Server Admin application.
    If you aren't at all familiar with vi, then you may want to instead create a text file on your desktop, put the content into it, then move it to the right location and change its ownership and permissions.
    Hope this helps.

  • Whitelist error

    Hello all
    I created a whitelist.plist file for our wiki to allow embedding google videos and youtube etc.
    However, all videos are automatically resized despite adjusting dimensions and fullscreen is disabled. Additionally, fonts remain uneditable. Furthermore the whitelist has caused problems with user permissions, allowing any user to edit and add new pages.
    any help is greatly appreciated.
    here is the code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--put in /Library/Application Support/Apple/WikiServer/ -->
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.
    com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>protocols</key>
    <array>
    <string>irc</string>
    <string>scp</string>
    </array>
    <key>styles</key>
    <array>
    <string>font-size</string>
    <string>font-color</string>
    <string>background</string>
    </array>
    <key>tags</key>
    <dict>
    <key>object</key>
    <array>
    <string>width</string>
    <string>height</string>
    <string>classid</string>
    </array>
    <key>param</key>
    <array>
    <string>name</string>
    <string>value</string>
    </array>
    <key>embed</key>
    <array>
    <string>id</string>
    <string>src</string>
    <string>type</string>
    <string>width</string>
    <string>height</string>
    <string>allowFullScreen</string>
    <string>allowScriptAccess</string>
    <string>wmode</string>
    </array>
    </dict>
    </dict>
    </plist>

    Earl,
    I posted my findings on a similar thread.
    http://discussions.apple.com/thread.jspa?threadID=1645188&tstart=0
    I cannot get it to work either, and I have tried a number of approaches. I think this feature is pretty flakey.
    RyanR>

  • Applet Does Not Receive Parameters Nor Display Defaults

    My applet will not display a Ellipse either via the default values in my java code nor via the parameters given in the HTML document. Does anyone see what I'm doing wrong here? Here are both my documents:
    import java.awt.geom.*;
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    public class CircleByParam extends javax.swing.JApplet
              private Ellipse2D.Float circle;
              private float x, y, w, h;
              private Color circlecolor;
              public void init ()
                        String xcoor = getParameter("X");
                        String ycoor = getParameter("Y");
                        String width = getParameter("W");
                        String height = getParameter("Y");
                        String fillcolor = getParameter("FillColor");
                        if (xcoor != null)
                                  x = IntVerification(xcoor);
                        else
                                  x = 25;
                        if (ycoor != null)
                                  y = IntVerification(ycoor);
                        else
                                  y = 25;
                        if (width != null)
                                  w = IntVerification(width);
                        else
                                  w = 25;
                        if (width != null)
                                  h = IntVerification(height);
                        else
                                  h = 25;
                        if (fillcolor != null)
                                  circlecolor = ColorVerification(fillcolor);
                        else
                                  circlecolor = Color.BLUE;
              private int IntVerification (String value)
                        int number = 5;
                        try
                                  number = Integer.parseInt(value);
                        catch (NumberFormatException e)
                                  this.showStatus("Bad parameter " + value);
                        return number;
              private Color ColorVerification (String value)
                        //Assigns color to BLACK by default
                        Color color = Color.BLACK;
                        try
                                  color = Color.decode(value);
                        catch (NumberFormatException e)
                                  this.showStatus("Bad parameter " + value);
                        return color;
              public void paint (Graphics2D screen)
                        Graphics2D screen2D = (Graphics2D)screen;
                        screen2D.setColor(circlecolor);
                        BasicStroke pen = new BasicStroke();
                        screen2D.setStroke(pen);
                        circle = new Ellipse2D.Float(x,y,w,h);
                        screen2D.fill(circle);
    HTML Document:
    <HTML>
         <HEAD>
              <TITLE>Java 21 Days - Day 12 Exercise 1</TITLE>
         </HEAD>
         <BODY BGCOLOR="WHITE">
         <APPLET CODE="CircleByParam.class" height = "400" width="400">
         <param name="X" value="200">
         <param name="Y" value="200">
         <param name="W" value="25">
         <param name="H" value="25">
         <param name="FillColor" value="#996633">
         This applet requires a Java-enabled browser.
         </APPLET>
         </BODY>
    </HTML>

    Nevermind I figured it out, needed to make sure the paint parameter was (Graphics screen) rather than (Graphics2D screen)

  • Compiler Error: Unable to load class

    Hi,
    I'm having trouble getting my first custom tag to work. Details of the setup follow:
    ============= Tag Handler =============
    package whichtorrent.tags;
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class ScoreBarTag extends TagSupport {
    private String
    info_hash,
    width,
    height,
    barWidth,
    padding,
    fontSize,
    showText,
    showBar,
    showPlug,
    showVoteLink,
    goodColour,
    badColour,
    endsColour;
    public void setInfo_hash(String info_hash)
    this.info_hash = info_hash;
    public void setWidth(String width)
    this.width = width;
    public void setHeight(String height)
    this.height = height;
    public void setBarWidth(String barWidth)
    this.barWidth = barWidth;
    public void setPadding(String padding)
    this.padding = padding;
    public void setFontSize(String fontSize)
    this.fontSize = fontSize;
    public void setShowText(String showText)
    this.showText = showText;
    public void setShowBar(String showBar)
    this.showBar = showBar;
    public void setShowPlug(String showPlug)
    this.showPlug = showPlug;
    public void setShowVoteLink(String showVoteLink)
    this.showVoteLink = showVoteLink;
    public void setGoodColour(String goodColour)
    this.goodColour = goodColour;
    public void setBadColour(String badColour)
    this.badColour = badColour;
    public void setEndsColour(String endsColour)
    this.endsColour = endsColour;
    public int doStartTag() throws JspException {
    try {
    pageContext.getOut().print("This is my first tag!");
    } catch (IOException ioe) {
    throw new JspException("Error: IOException while writing to client"
    + ioe.getMessage());
    return SKIP_BODY;
    public int doEndTag() throws JspException {
    return EVAL_PAGE;
    ============== Library Descriptor ==============
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//
    DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <!-- a tag library descriptor -->
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>wt</shortname>
    <uri>www.whichtorrent.info</uri>
    <info>WhichTorrent Tags (http://www.whichtorrent.info)</info>
    <tag>
    <name>scoreBar</name>
    <tagclass>whichtorrent.tags.ScoreBarTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>Graphically display score for a given torrent.</info>
    <attribute>
    <name>info_hash</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>width</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>height</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>barWidth</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>padding</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>fontSize</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>showText</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>showBar</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>showPlug</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>showVoteLink</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>goodColour</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>badColour</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>endsColour</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    ============== Test Page ===============
    <%@ taglib uri="/WEB-INF/jsp/whichtorrentTaglib.tld"
    prefix="wt" %>
    <HTML>
    <HEAD>
    <TITLE>Tag Test</TITLE>
    </HEAD>
    <BODY bgcolor="#ffffcc">
    <B>wt:scoreBar prints</B>:
    <wt:scoreBar info_hash="" width="" height="" barWidth="" padding="" fontSize="" showText="" showBar="" showPlug="" showVoteLink="" goodColour="" badColour="" endsColour=""/>
    </BODY>
    </HTML>
    ====================================
    The compiler gets quite far, beyond checking that all the set methods are there, but then i get the message:
    org.apache.jasper.compiler.CompileException: /whichtorrent/tagTest.jsp(12,0) Unable to load class whichtorrent.tags.ScoreBarTag
    My directory structure is:
    /WEB-INF/whichtorrent/tags/ScoreBarTag.class
    /WEB-INF/jsp/whichtorrentTaglib.tld
    /whichtorrent/tagTest.jsp
    Any help would be very much aprreciated.
    Regards
    ~felix

    they are.. sorry i made a mistake in my original post. My class file is in..
    /WEB-INF/classes/whichtorrent/tags/
    Thanks for the prompt reply
    ~felix

  • Does apex support any server side JSP or PHP?

    I have the folowing script that is used to save flash files as images. I am hoping there is some way to make these serverside calls from within apex.
    <%@ page import="java.io.OutputStream"%>
    <%@ page import="java.awt.Color"%>
    <%@ page import="java.awt.Graphics"%>
    <%@ page import="java.awt.image.BufferedImage"%>
    <%@ page import="javax.imageio.ImageIO"%>
    <%
         //Decoded data from charts.
         String data="";
         //Rows of color values.
         String[] rows;
         //Width and height of chart.
         int width=0;
         int height=0;
         //Default background color of the chart
         String bgcolor="";
         Color bgColor;
         //Get the width and height from form
         try{
              width = Integer.parseInt(request.getParameter("width"));
              height = Integer.parseInt(request.getParameter("height"));     
         catch(Exception e){
              //If the width and height have not been given, we cannot create the image.
              out.print("Image width/height not provided.");
              out.close();
         if(width==0 || height==0){
              //If the width and height are less than 1, we cannot create the image.
              out.print("Image width/height not provided.");
              out.close();
         //Get background color from request and set default
         bgcolor =request.getParameter("bgcolor");
         if (bgcolor==null || bgcolor=="" || bgcolor==null){
                   bgcolor = "FFFFFF";
         //Convert background color to color object     
         bgColor = new Color(Integer.parseInt(bgcolor,16));
         //Get image data  from request
         data = request.getParameter("data");
         if(data==null){
              //If image data not provided.
              out.print("Image Data not supplied.");
              out.close();
         try{
              //Parse data
              rows = new String[height+1];
              rows = data.split(";");
              //Bitmap to store the chart.
              //Reference to graphics object - gr
              BufferedImage chart = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);
              Graphics gr = chart.createGraphics();
              gr.setColor(bgColor);
              gr.fillRect(0,0,width,height);     
              String c;
              int r;
              int ri = 0;
              for (int i=0; i<rows.length; i++){
                   //Split individual pixels.               
                   String[] pixels = rows.split(",");               
                   //Set horizontal row index to 0
                   ri = 0;
                   for (int j=0; j<pixels.length; j++){                    
                        //Now, if it's not empty, we process it                    
                        //Split the color and repeat factor
                        String[] clrs = pixels[j].split("_");     
                        //Reference to color
                        c = clrs[0];
                        r = Integer.parseInt(clrs[1]);
                        //If color is not empty (i.e. not background pixel)
                        if (c!=null && c.length()>0 && c!=""){          
                             if (c.length()<6){
                                  //If the hexadecimal code is less than 6 characters, pad with 0
                                  StringBuffer str = new StringBuffer(c);
                                  int strLength = str.length();
                                  for ( int p = c.length()+1; p <= 6 ; p ++ ) {
                                            str.insert( 0, "0" );
                                  //Assing the new padded string
                                  c = str.toString();
                             for (int k=1; k<=r; k++){     
                                  //Draw each pixel
                                  gr.setColor(new Color(Integer.parseInt(c,16)));
                                  gr.fillRect(ri, i,1,1);
                                  //Increment horizontal row count
                                  ri++;                              
                        }else{
                             //Just increment horizontal index
                             ri = ri + r;
              //Returns the image
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition", "attachment; filename=\"FusionCharts.jpg\"");
              OutputStream os = response.getOutputStream();
              ImageIO.write(chart, "jpeg", os);
              os.close();
         }catch(Exception e){
              //IF the image data is mal-formatted.
              out.print("Image data is not in proper format.");
              out.close();
    %>

    NO, APEX does NOT support running jsp or PHP scripts..
    Thank you,
    Tony Miller
    Webster, TX

  • Cann't change appete's appearance

    I'm using netbeans IDE to build an applet which can work for both sun jvm and microsoft jvm.
    I copied a simple "Hello world" applet from internet as below and built it in netbean IDE using javac.exe under java1.1. It worked in appletviewer and in IE 6(mjvm). the only problem is: I cann't use Applet.setSize(); to change the size of the applet in IE and cann't change the position of the string in applet by changing the (x,y) in Graphic.drawingString(String s, x, y) . All these things can be changed in appletviewer.
    import java.applet.Applet;
    import java.awt.Graphics;
    public class testApplet extends java.applet.Applet {
    /** Initialization method that will be called after the applet is loaded
    * into the browser.
    public void init() {
    super.setSize(500, 600);
    validate();
    public void paint(java.awt.Graphics g) {
    g.drawString("Hello world!", 200,300);
    I'll appreciate it if somebody can explain this .
    Thanks
    Jane

    the position of the string in applet is relative to the displayed size of the applet so you can set the position of the string within the applet by passing it as parameters to the applet through the param tags like this:
    <applet code=testApplet.class width=500 height=600>
    <param name=width value=200>
    <param name=height value=300>
    </applet>
    and then in your applet class you can retrieve and set the param values like this:
    import java.applet.Applet;
    import java.awt.Graphics;
    public class testApplet extends java.applet.Applet {
    String width = "";
    String height = "";
    /** Initialization method that will be called after the applet is loaded
    * into the browser.
    public void init() {
    super.setSize(500, 600);
    validate();
    //retrieving parameters from the param tags
    width = request.getParameter("width");
    height = request.getParameter("height");
    public void paint(java.awt.Graphics g) {
    //setting the parameters within the g.drawString() method
    g.drawString("Hello world!", width, height);

  • How to add events to a ordinary html tag

    How can i add a event to ordinary tag
    Ex:
    public void encodeBegin(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement("div", this);
    writer.writeAttribute("id", getClientId(context), null);
    String width = (String)getAttributes().get("width");
    String height = (String)getAttributes().get("height");
    String style = (String)getAttributes().get("style");
    style= (style!=null) ? style + ";" : "";
    if (width != null) style += "width:" + width + ";";
    if (height != null) style += "height:" + height+ ";";
    writer.writeAttribute("style", style, null);
    String styleClass = (String)getAttributes().get("styleClass");
    if (styleClass!=null)
    writer.writeAttribute("class", styleClass, null);
    String title = (String)getAttributes().get("title");
    if (title!=null)
    writer.writeAttribute("title", title, null);
    public void encodeEnd(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.write("<input type=\"button\" name=\"but\"/>");
    writer.endElement("div");
    i want to add event and bean for the <<< writer.write("<input type=\"button\" name=\"but\"/>"); >>>line of code, which is nothing but a button. I can added using JSF concept. but the requirement is like this. I have to add normal html tag for which i have to use bean and events as well.
    Can anyone give suggestion for this

    I will give a clear example
    writer.write("<h:outputText id=\"txt\" value=\"Just a Display\" />");
    writer.write("div");
    this 2 lines is in endcodeEnd method. The output text wont display the msg.
    even i am writing before the end tag
    Here is the full code
    ================
    public void encodeBegin(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement("div", this);
    writer.writeAttribute("id", getClientId(context), null);
    String width = (String)getAttributes().get("width");
    String height = (String)getAttributes().get("height");
    String style = (String)getAttributes().get("style");
    style= (style!=null) ? style + ";" : "";
    if (width != null) style += "width:" + width + ";";
    if (height != null) style += "height:" + height+ ";";
    writer.writeAttribute("style", style, null);
    String styleClass = (String)getAttributes().get("styleClass");
    if (styleClass!=null)
    writer.writeAttribute("class", styleClass, null);
    String title = (String)getAttributes().get("title");
    if (title!=null)
    writer.writeAttribute("title", title, null);
    public void encodeEnd(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.write("<h:outputText id=\"txt\" value=\"Just a message\" />");
    writer.endElement("div");
    writer.write("<h:outputText id=\"txt\" value=\"Just a message\" />");
    This line is not executing
    kindly reply me..
    my mail id is [email protected]

  • Number Of Visible Rows in a ScrollPane

    Hi All,
    I'm a little embarassed about needing help with something like this but I've tried several approaches and I'm just not getting it!
    I have a JTextArea inside a JScrollPane and basically I want to introduce a little algorithm where I set the min, max and preferred sizes of this combo-widget to control real-estate usage (ie. only take up the minimum number of rows to display the text, but never more than a maximum configured by the user - it's a little different from the default behavior)
    I would need a way of querying the JScrollPane to find out how many visible rows he's actually displaying at a moment in time.
    My most promising (but flawed) attempt so far has been to set a listener on a viewport change event, and then to get the viewport extent height and compare it to the JTextArea's string height (which I was hoping coresponded to the height for one line of text).
    double viewPortHeight = vp.getExtentSize().getHeight();
    // get the height of one line of text to determine the
    // number of rows being used
    double textHeight = textArea1.getBounds().getHeight();
    ...but of course they're tracking one another. How do I get the height of a single line???

    Hi Dubwai,
    I'm not sure I understand what you are trying to
    achieve. Could you explain more about why you have > to constantly resize?Basically, the JTextArea/JScrollPane combo will be used in a table renderer for a few very important string columns in a table. There is no upper limit on the amount of text which can be entered in the column and the information in those columns is important enough that the customer has specified that they would like the entire thing to be visible as often as possible. They are defining a maximum number of rows (5-6) for one entry beyond which I will be able to put a scrollbar up. The width of the column for these fields will be fixed (at about 40 chars).
    Additionally, real-estate in the table is at a bit of a premium I also don't want to waste any space in it by showing 2 rows for an entry where 1 row would suffice.
    In a nutshell, I need a text area that is aware of how much space it requires and which will always try to minimize the number of rows it takes up. I thought that by determining how many rows were necessary for displaying a given bit of text, that I could force the JScrollPane size accordingly.
    I'll spend some time looking at setRows(), but from looking at the API I got the impression that that only ultimately affected the preferred size. I was really hoping for a bit more control - for these specs, the minimum, maximum and preferred size will all be the same.

Maybe you are looking for