How can i Change the Size of the selected text in JTextPane using ConboBox

plzz help...
How can i Change the Size of the selected text in JTextPane using ConboBox ???
i m using if(cb.getSelectedItem=="small")
cb.setAction(new StyledEditorKit.FontSizeAction("double click", 12);)
if(cb.getSelectedItem=="medium")
cb.setAction(new StyledEditorKit.FontSizeAction("double click", 14);)
if(cb.getSelectedItem=="large")
cb.setAction(new StyledEditorKit.FontSizeAction("double click", 16);)
this code is not working properly according to the action i set on comboBox.
when i select medium the previously set action on comboBox works like small action work.
when i select large the medium action starts .
means its not working in correct time when i select item of combox n action of that item is not working at that time..
plzz plzz help me:(

Action action1 = new StyledEditorKit.FontSizeAction(
"double click", 12);
Action action2 = new StyledEditorKit.FontSizeAction(
"double click", 14);
Action action3 = new StyledEditorKit.FontSizeAction(
"double click", 18);
s2 = (String) cb7.getSelectedItem();
if (s2.equals("Small")) {
cb7.setAction(action1);
e1.setSource(cb7);
} else
if (s2.equals("Medium")) {
cb7.setAction(action2);
e1.setSource(cb7);
} else if (s2.equals("Large")) {
cb7.setAction(action3);
// e1.setSource(cb7);
when i chooze any combobox item then according to that item i set the Action on ComboBox but that action is not working properly on the selected text in the JTextPane..means selected text in JText Pane is not changes its Size according to the comboBox selected ITEM.
PLZ plzzzzzzzzzz help me:((.i will be thankfull to u.

Similar Messages

  • How can I change the default text color (black to blue) in Mail on Mountain Lion

    How can I change the default text color (black to blue) in Mail on out going email with Mountain Lion

    There really aren't default outgoing font settings. They are only there for viewing. A workaround I have seen mentioned is to start you signature with the font style you want to use. When you start your message, click in that first part of your signature.
    Something like
    defaults
    Signature

  • How can I change the phone number that's used for my iMessages

    How can I change the phone number that's used for my iMessages

    I Know but i did a number port and the iMessages is showing up using the original number that I had when I first purchased this phone from tmobile

  • How can i change the default text "Query by Example"

    Studio Edition Version 11.1.1.3.0
    how can i change the default text *"Query by Example"* in a Panel Collection
    Thx

    Hi thieto,
    The label you are looking for is af_panelCollection.LABEL_MENUITEM_QBE*
    I'm currently writing a blogpost on this issue. In short, you will have to create a skin resource bundle.
    In the skin definition, refer to this bundle class.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <skins xmlns="http://myfaces.apache.org/trinidad/skin">
      <skin>
        <id>mySkin.desktop</id>
        <family>MySkin</family>
        <extends>blafplus-rich.desktop</extends>
        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
        <style-sheet-name>skins/MySkin.css</style-sheet-name>
        <bundle-name>com.blogspot.lucbors.view.bundles.MySkinBundle </bundle-name>
      </skin>
    </skins>In this class, adjust the label text to your needs.
    package com.blogspot.lucbors.view.bundles;
    import java.util.ListResourceBundle;
    public class MySkinBundle extends ListResourceBundle {
      public MySkinBundle() {
        super();
    @Override
      public Object[][] getContents() {
        return _CONTENTS;
    static private final Object[][] _CONTENTS = {
         {"af_panelCollection.LABEL_MENUITEM_QBE","the text that you want"}
    }More in the blogpost
    Good luck
    Luc Bors
    Edited by: lucbors on Jul 26, 2010 11:39 AM (blogpost finished - URL added)

  • How can i change the default application that Lion uses to open a document?

    how can i change the default application that Lion uses to open a document?

    Right-click on the document, select Get Info... In the lower half of the tall window that opens is a section labeled Open With (you may need to click on the disclosure triangle to see detail). Select from the pop-up list which app should open this document. If you want that to become the default condition, click on the Change All... button.

  • How can i change the undisclosed text of Detail Disclosure in a table

    Hi.
    I have a new OAF page, with an advanced table.
    The table has a Detail Disclosure (a row-level Hide/Show in a table).
    By default, the prompt is "Show" or "Hide" for disclosed/undisclosed state.
    I need to change this text to another text, like"payment".
    How can i change the text of the table Detail Disclosure?
    Please help...

    I found this reference in the guide:
    In accordance with BLAF guidelines, the Detail column header text for the detail disclosure column and the Show/Hide link texts within the cells of the detail disclosure column can not be modified.
    I guess it is currently not possible.
    Regards,
    LC

  • I would like to change the project page layouts, but setup option in Project Superuser are not available. How can I change the selected page layouts?

    Hi
    I updated the page layouts for a project in Project Management. Now I woujld like to change those chosen page layouts, but the setup options for the project are no longer available for me to change. How can I update the original chosen page layouts (for performance management) to different layouts or change the chosen layouts to the default (blank) layouts?
    Thanks
    Chris van de Graaf

    AppleMan,
    It all began inside the settings of my Sanyo VPC-HD2000A when somehow the selection got switched from 1280 x 720 to that other setting with so-called 25fps. Also, I don't know whether the mishap occurred before or after I took my new footage.
    I edited the clips last night and now they are on my blog and channel and they seem ok but slightly fuzzy.
    I used a Sanyo VPC-HD2000A .7x wide angle lens with macro and I notice that when I zoomed in to the little sun conure, the picture blurred. I think that might be something that happens when one zooms the focus.
    Also, I was born and raised to a teenager in Hawaii, but now Southern California has me in its grip.
    -L

  • How can I change the 'selected' color of one JToggleButton only.

    Hi,
    This seems like a simple / trivial question, but I just can't figure it out. Is there a way that I can create a JToggleButton and change the selected color of only that JToggleButton.
    I'm trying to create a simple sidebar like component for navigation within my app. A group of JToggleButton[s] added to a ButtonGroup (with the proper layout / sizing) works great, but the default JToggleButton colors don't suit my needs. I know that I can change the colors using the UIManager / UIDefaults, but I don't want to change the defaults for every JToggleButton in my app. I only want to change the defaults for a few select JToggleButton[s].
    For example, I can do this:
    UIManager.put("ToggleButton.select", UIManager.getColor("Table.selectionBackground"));
    UIManager.put("ToggleButton.background", UIManager.getColor("Table.background"));but I'd rather do something like this:
    JToggleButton jtb = new JToggleButton("Toggle Button Text");
    jtb.setSelectedColor(UIManager.getColor("Table.selectionBackground"));
    jtb.setBackground(UIManager.getColor("Table.background"));The only thing is, I can't find any method that is the equivilant of 'setSelectedColor(Color)' for JToggleButton.
    I know I could do it by adding some listeners to the JToggleButton[s], but that seems a little complicated for something like changing a color.
    I'd also seen a solution in the forums where someone had extended the ButtonUI of the pluggable look and feel they were using. I'm not interested in modifying the look and feel I'm using. As far as I'm concerned, that would defeat the purpose of having a pluggable look and feel as I would have to duplicate my efforts for every look and feel I want to use.
    Any help would be appreciated,
    Ryan

    try this
    import javax.swing.*;
    import java.awt.*;
    class Testing extends JFrame
      public Testing()
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(250,75);
        setLocation(400,300);
        JPanel jp = new JPanel();
        JToggleButton jtb = new JToggleButton("Toggle me");
        jtb.setUI(new MyUI());
        jp.add(jtb);
        getContentPane().add(jp);
      public static void main(String args[]){new Testing().setVisible(true);}
    class MyUI extends javax.swing.plaf.metal.MetalToggleButtonUI
      public Color getSelectColor(){return Color.BLACK;}
    }

  • How do I change the selected text of a combobox on the fly?

    Hi all,
    I am trying to make a combobox, that is sort of a "recently used" connection box. So you can type in a computer name, hit connect and it then connects. When you disconnect, it adds the computer name, and the logged in username to the combobox,
    so when you click on the drop down, you get selections for example : "COMPUTER1 - johnsmith"
    Which is cool, but what I want, is to be able to click on the selection, and it only puts the computer name in the TextBox - i.e. "COMPUTER1"
    So I have done a bit of research, and tried making a hashtable, and using the DisplayMember and ValueMember properties, so i can at least have a combobox selection like "COMPUTER1 (johnsmith)". I have tried many different pages and suggestions,
    but the furtherest I have got is to only have one or the other value display, or it displays as System.Collection...... (can't remember the rest).
    So my next attempt, is using an event handler for the combobox to change the text, so that once "COMPUTER1 - johnsmith" is selected from the combobox, it puts "COMPUTER1" as the selected text.
    I have tried the following using the SelectedIndexChanged handler. Here is a snippet of my code relating to the ComboBox:
    # PC Connection Input Box$global:pcInputBox = New-Object System.Windows.Forms.ComboBox
    $global:pcInputBox.Location = New-Object System.Drawing.Size(70,50)
    $global:pcInputBox.Size = New-Object System.Drawing.Size(210,20)
    $global:pcInputBox_SelectedIndexChanged = {
    if (($global:pcInputBox.Text -ne $null) -and ($global:pcInputBox.Text -ne "")){
    $selection = $global:pcInputBox.Text
    addLog("Selection is $selection")
    $global:trimSelection = $selection.substring(0,$selection.indexof("-"))
    addLog("TrimSelection is $global:trimSelection")
    $global:pcInputBox.SelectedItem = $global:trimSelection
    addLog("SelectedText is $global:pcInputBox.SelectedItem")
    $global:pcInputBox.add_GotFocus({
    $Form.AcceptButton = $pcButton
    $global:pcInputBox.add_SelectedIndexChanged($global:pcInputBox_SelectedIndexChanged)
    $Form.Controls.Add($global:pcInputBox)
    I have also tried setting the $global:pcInputBox.Text but the result is that nothing changes. Its as though I can't change that ComboBox from its own event?? If I try setting $global:pcInputBox.Text from another function, it will do it fine.
    Can anyone please recommend how I would get this achieved?
    Thanks in advance
    Adam Street

    Use objects:
    $o=@()
    $o+=New-Object PsObject -Property @{Computer='COMP1';User='USER01'}
    $o+=New-Object PsObject -Property @{Computer='COMP2';User='USER02'}
    $o+=New-Object PsObject -Property @{Computer='COMP3';User='USER03'}
    $combobox1.DataSource=[collections.arraylist]($o|select Computer,User, @{N='DisplayName';E={"$($_.Computer)-$($_.User)"}})
    $combobox1.DisplayMember='DisplayName'
    This can also be loaded from a CSV or from AD or almost anywhere else;
    Here is another trivial example:
    $o=@()
    $o+=New-Object PsObject -Property @{Computer='COMP1';User='USER01'}
    $o+=New-Object PsObject -Property @{Computer='COMP2';User='USER02'}
    $o+=New-Object PsObject -Property @{Computer='COMP3';User='USER03'}
    Add-Type -AssemblyName System.Windows.Forms
    $form=New-Object System.Windows.Forms.Form
    $form.StartPosition='CenterScreen'
    $combobox1 = New-Object System.Windows.Forms.ComboBox
    $combobox1.Location='70,50'
    $combobox1.Size='210,20'
    $combobox1.DataSource=[collections.arraylist]($o|select Computer,User, @{N='DisplayName';E={"$($_.Computer)-$($_.User)"}})
    $combobox1.DisplayMember='DisplayName'
    $combobox1.add_SelectedIndexChanged({[System.Windows.Forms.MessageBox]::Show($combobox1.SelectedItem.Computer)})
    $form.Controls.Add($combobox1)
    $form.ShowDialog()
    ¯\_(ツ)_/¯

  • How Can I change the default system editor to use it on Eclipse?

    Hi, I want to know something. In Eclipse, when I do the following with a file: Open With -> System Editor, GVIM is opened, and I would want to change this behaviour to another editor.
    How Can I perform this?
    Greetings

    Davigetto wrote:
    It doesn't work to eclipse... I don't know why, always gvim is opened... If I uninstall gvim, eclipse give me an error telling to me that was impossible to open the system editor.
    The variables mentioned above initially were empty (without content).
    Any more ideas?
    Greetings
    I'm pretty sure those ENV variables are only used for terminal / console operations, not GUI functionality. I think the confusing issue here, perhaps, was that Eclipse calls the option 'system editor.'
    What it is referring to, instead, is the application set in your file manager for opening a particular file type. For me, it opens Scite, as I have Scite set in Nautilus to open most 'text' types. However, I can change the behavior to open Komodo Edit for *.py files by simply right clicking on any *.py file, selecting 'Properties' and setting the appropriate editor in the 'Open with' tab. Now *.py files open in Komodo in any circumstance, including selecting 'Open wirh > system editor' in Eclipse.
    The procedure will be slightly different depending on your DE / file manager.
    Last edited by MrWeatherbee (2007-12-01 10:26:56)

  • How can I change the default text on my homepage tab?

    When my homepage displays it has some kind of weird garbled text in the page tab at the top. Is it just a placeholder? How do I change it?

    It's not "some kind of weird garbled text". It's called Latin, an ancient language. Learned people still speak it. And it's taught in institutes of higher learning.
    It's also used as placeholder text in printing :
    http://www.lipsum.com/
    See the image below where the text originates.
    But you have some issues on your page that can be solved by simply paying attention to what you do.
    First there's an image covering the links. Old Toad referred to that. Move it down, or change the dimensions :
    And that "some kind of weird garbled text" is hidden behind your brochure :
    Read this to learn how iWeb creates the title in the titlebar :
    iWeb uses the textbox in the Header layer of an iWeb page as the title in the browserwindow.
    Do not remove the original textbox, as you cannot replace it other than by selecting another theme and then change it back to the original theme again. Ruining the layout in the process.
    If the textbox in the Header is missing, iWeb uses a textbox down the page in the Content layer. If that textbox is also missing, it uses another textbox. If that fails it uses the pagename in the Sidebar.
    Sometimes you may want a different text in the titlebar and not display it on the page itself. Or not display it at all.
    So use that textbox in the Header layer. Type your text. Then select the textbox. In the Inspector choose T, click a color to open the color palette and drag the opacity slider to 0 (zero).
    Do Command-T to open the font palette and make the font smaller. (Or do Command--(minus)) Also use a font that doesn't change to an image. Arial is a good font. Perhaps do it first before making the text invisble.
    Resize the textbox. You may want to change the height of the Header layer.
    Do Command-Shift-B to move the textbox to the back, possibly behind other objects.
    Next add a optional second textbox to the Header layer and use that one to display text on the page.
    If you want to move the textbox to the front again to make changes, but can't remember the location on the page, drag the area with the mouse to select the objects.
    Deselect objects you do not want to move forward by Command-dragging the mouse over these objects.
    Next do Command-Shift-F to move the textbox to the front. Repeat the steps in reverse order to make the text visible.
    Practice.

  • How can I change the order of menu items using Term Store Navigation?

    A cool new feature in SharePoint 2013 is term store navigation. However SharePoint seems to be ordering my terms (menu tabs) alphabetically. This is not a desired action.
    I tried to enter the terms in the order I wanted them to appear (IE - Home, About, Contact etc. ) but my menus are still sorted by alpha (About, Contact, Home). I have tried to change the order using the interface but it doesn't seem to work.
    Any suggestions on how to obtain the desired effect?  If there is no workaround this feature is practically useless.
    The Web Guy

    Never mind, I just found the custom sort tab hidden away!
    The Web Guy

  • How can I change the startup language when I use the internet?

    I have the macbook pro that i have just bought in Russia. The reason I bought it here is because I wanted to have both the English and Russian letters on the keyboard. Apart from that I don't care much for the Russian system, since I have always used an American version mac.
    Anyway, on to the question. I have English and Russian setup as my two input languages on the computer. I know how to switch between them, and everything is fine. But, I have come across a problem that I never encountered before as all my macs have been purchased in America before this one. Every time I open a new internet window, tab, new program such as skype, it is always the Russian language that is selected, even if I have been using the American keyboard prior to that. It starts getting frustrating, especially when I get used to to typing something, and then without looking continue to type in a different page and look up to see a bunch of Russian letters making no sense.
    I hope there is a solution to that, and I won't just have to get annoyed with this for the rest of my relationship with my new macbook pro!

    Tom Gewecke wrote:
    Language Switcher is for changing the language of the menus and dialogues displayed by an app and does not affect the keyboard being used.
    i should have read the post more carefully
    thanks for the clarification, Tom !
    JGG

  • How can I change the firefox text find color?

    When you press CTRL+F in Firefox to bring up the text search and you search for a word, the word is highlighted in this neon green color. Is there a way to change the color of this? The green color is hardly visible.

    Hi Pino76,
    You should take a look at:
    http://kb.mozillazine.org/About%3Aconfig_entries#UI.
    Just type ''about:config'' into your browser
    ui.textSelectBackgroundAttention is the entry you want to modify. Just add the hex value of the color you want.
    If that entry isn't there, you can create it.
    Hopefully this helps!

  • In Acrobat 8 Professional, how can I change the typewriter text color?

    I tried selecting the text then pressing Ctrl-E but the text properties toolbar that appears says, "No current selection." I tried this method another user suggested:
    "1. Use the text box tool to type some text, then select the text
    2. Use the properties bar, ctrl-E, or View > Toolbars > Properties Bar, to change the color of the font
    3. Highlight the text, not the text box and copy the text.
    4. Click on the typewriter tool and type some text.
    5. Click on the comments menu and select "Show Comments List", in the comments list you should see the typewriter entry from step 4 above.
    6. Highlight the typewriter text in the comments window then paste the copied text from step 3 above.  It should paste with the color selected in the properties bar.
    7. Right click an area of the typewriter entry in the comments list, and choose properties.
    8. On the General tab check the "Make Properties Default" Check box and click OK.
    All new typewriter entries should now use this new font color. "
    But when I get to STEP #2 the text properties toolbar that appears has all the options to edit the text shaded so I cannot select the option to change the text color. Any help would be appreciated!

    There really aren't default outgoing font settings. They are only there for viewing. A workaround I have seen mentioned is to start you signature with the font style you want to use. When you start your message, click in that first part of your signature.
    Something like
    defaults
    Signature

Maybe you are looking for