Marker and line styles as a choice in drop down menu

Is it possible to create a drop down choice menu(Choice xyz = new Choice(); ) in java AWT which has line styles or marker styles (no text)( basically these things are required to edit the graph) as choice options?

/*  <applet code="ChoiceTest" width="400" height="400"></applet>
*  use: >appletviewer ChoiceTest.java
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class ChoiceTest extends Applet
    ChoiceGraphicsPanel graphicsPanel;
    Choice choice;
    Checkbox rows, cols;
    String[] colorNames;
    public void init()
        graphicsPanel = new ChoiceGraphicsPanel();
        setLayout(new BorderLayout());
        add(getChoicePanel(), "North");
        add(graphicsPanel);
    private Panel getChoicePanel()
        rows = new Checkbox("rows", true);
        cols = new Checkbox("cols", false);
        colorNames = new String[] {
            "red", "green", "blue", "orange"
        choice = new Choice();
        for(int j = 0; j < colorNames.length; j++)
            choice.add(colorNames[j]);
        choice.addItemListener(new ChoiceListener());
        Panel panel = new Panel();
        ((FlowLayout)panel.getLayout()).setHgap(35);
        panel.add(choice);
        panel.add(rows);
        panel.add(cols);
        return panel;
    private class ChoiceListener implements ItemListener
        Color[] colors = {
            Color.red, Color.green.darker(), Color.blue, Color.orange
        public void itemStateChanged(ItemEvent e)
            if(e.getStateChange() == ItemEvent.SELECTED)
                int index = choice.getSelectedIndex();
                Color color = colors[index];
                if(rows.getState())
                    graphicsPanel.setRowColor(color);
                if(cols.getState())
                    graphicsPanel.setColColor(color);
    public static void main(String[] args)
        Applet applet = new ChoiceTest();
        final Frame f = new Frame();
        f.addWindowListener(new WindowAdapter()
            public void windowClosing(WindowEvent e)
                f.dispose();
                System.exit(0);
        f.add(applet);
        f.setSize(400,400);
        f.setLocation(200,200);
        applet.init();
        f.setVisible(true);
class ChoiceGraphicsPanel extends Panel
    int rows, cols;
    Color rowColor, colColor;
    public ChoiceGraphicsPanel()
        rows = 4;
        cols = 4;
        rowColor = Color.red;
        colColor = Color.blue;
    public void paint(Graphics g)
        super.paint(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        int w = getWidth();
        int h = getHeight();
        int xInc = w/cols;
        int yInc = h/rows;
        int y = 0;
        g2.setPaint(rowColor);
        for(int j = 0; j < rows; j++)
            g2.drawLine(0, y, w, y);
            y += yInc;
        int x = xInc;
        g2.setPaint(colColor);
        for(int j = 0; j < cols - 1; j++)
            g2.drawLine(x, 0, x, h);
            x += xInc;
    public void setRowColor(Color color)
        rowColor = color;
        repaint();
    public void setColColor(Color color)
        colColor = color;
        repaint();
}

Similar Messages

  • Input Masks and Single Choice Fields (drop down menu) Suggestions

    Here's a few suggestions - I hope this is the right place to post these...
    1. I would like to suggest a pre-filled state single choice field (drop down menu) to be used to get address information.  Or better yet a way to import a csv file to fill the preset fields for an option box.
    2. Input masks that force users to enter the data in the format you prefer.  (000) 000-0000
    3. Ability to enable or disable options depending on other choices.
    4. Option for a list of numbers say 1 thru 100 and as people pick a registration (car number in my case) that choice cannot be picked again by another user for that form.  Load values from a table that can be picked several times or only once could work in both my suggestions.
    Thank You.

    Hello there,
    Thanks for these thoughts! They're all really good (and welcome) suggestions for additions to the FormsCentral service. As you might imagine, we're busily working back here to implement new features; we have big plans for FormsCentral. For these suggestions in particular, I'll do two things:
    1. Send these suggestions to the product team and get them added to the to-do list!
    2. Move the whole thread here into the FormsCentral Ideas sub-forum. That way, your suggestions will be noted as such and well-documented on our end.
    Thanks for the great ideas; let us know if you have any more feedback for us!
    Best regards,
    Rebecca
    Acrobat Services Community Manager

  • How to find the size and resolution option in the aspect ratio drop down menu for the crop tool

    while looking through certain tutorials on the new crop system i came across many that referenced the above mentioned size and resolution option in the  access ratio drop down menu.  They all mention a dialog box which then appears which looks really useful, however my version doesnt have this option. any help would be appreciated.

    Trevor.Dennis wrote:
    John, are there already differences?  I thought 13.1 was mainly about retina display support, but I guess there would also be other fixes released while they were at it.
    Yes, definitely already differences. I sympathize with Photoshop instructors (online and offline).
    The headline change was Retina support but that was also made available to non-Cloud versions.
    Other Cloud-only changes in 13.1 are listed here
    http://helpx.adobe.com/photoshop/using/whats-new.html
    http://psd.tutsplus.com/articles/news/cs6_1/
    Non-Cloud CS6 users have been very vocal and disgruntled about some of these changes.

  • How can I get rid of "History and Bookmarks" section from the search history drop down menu in safari 6.0.2?

    Let's just say I have saved bookmarks of things that i do NOT want my friends to see when they use my computer occasionally. I know they could go and find these bookmarks anyway in the bookmarks menu but they dont snoop around my computer. i would rather it not just pop up when they go to search for something or type in a webpage. If there is no way to customize what shows up in the drop down menu for search results then that is something apple overlooked. Not everybody wants things all in one place. Whats the point of deleting search history and website history if its just going to show the certain things you have bookmarked? Any solution to this would be appreciated. One solution i thought would work was disabling search from suggesting, but i guess that only supresses the webpages not the url/search bar. Oh and this is for safari 6.0.2 please dont give me outdated advice.
    Thanks

    Activate the Guest account for your friends and keep your account for yourself.

  • In System Preferences,  and CDs &DVDs, I've set the drop-down menu for audio CDs to open iTunes. can anyone tell me why it always reverts to Ignore?

    Can anyone help me figure out why the setting in System Preferences and CDs & DVDs will always revert to Ignore when I set the drop-down menu to When you insert a music CD, to Open ITunes? I've tried iTunes Help and it told me exactly what I have been doing. I've even tried downloading iTunes again, to no avail. If anyone has had the same problem, please let me know. I would very much appreciate it.

    In iTunes Preferences not system preferences under the General Tab there is a drop down in the lower part letting you specify what action to take when a CD is inserted
    Show CD
    Begin Playing
    Ask To Import
    Import CD
    Import and Eject
    I believe this setting adds to the system preferences
    In system Preferences I have

  • I would like to create a web that gives users choices from drop down menu and it then calculates the results back to them and copy to me

    Hello I am a wedding planner and have decided to create new website.   I would like to have the user make choices of different items and have it calculate so that they can print it off.  Like an estimate of what costs would be to plan a wedding .  I will be giving them different selections to choose from  in drop down or radio selections .
    I was thinking much like a shopping cart but that seems too involved is there a simpler way.   Thank you for any help.

    Just based on your question I can tell that you're probably not experienced enough to develop something like a shopping cart. Hiring a web developer is the way to go, as previously said.

  • Show/Hide fields based on choices in drop down menu

    I need help with a script that I cobbled together from an example script; I'm not good enough at java to edit it for my needs.
    I have a form where I would like different drop down fields would be visible/hidden depending on the choices made from other drop down menus.
    If (for example) they select paper type "white" or "color" then "white" will result in a second menu of paper choices, the "color" selection result in them picking the paper wieght, then from there the color.
    My problem stems from the fact that my form is very linited in space, so I would like some of these fields to be essentially on top of each other; visibility dependant on previous choices. I can get to Menu 1 (select paper color) and then Menu 2 if they select white. But there's a problem with setting up a third menu in this series, if they select "color" from Menu 1, then I try to have a drop down for paper weight, all the fields except for Menu 1 are hidden. Playing with the script let me have them all visible, but again, I'm limited on space and can't really spread them out.
    I know I'm missing one small command... somewhere.
    Here is the script I'm working with:
    function control_section_fields() {
        if (event.willCommit) return;
        // Get the value selected in the combo box
        var section = event.changeEx;
       // Hide all of the entry fields
        getField("sec").display = display.hidden;
        // Reset all of the entry fields
        resetForm(["sec"]);
        // Display the fields for the selected section
        getField("sec." + section).display = display.visible;
    where the drop down fields are named "sec.a.dd" for example, and the Export value of different values are assigned as "a", "b", etc.
    Sorry for the rambling. Any help will be greatly appreciated.

    also, if "==" could be roughly translated to "is", "!=" would mean "is not".
    JavaScript is Case sensitive so make sure you did not name your field STATE#1 instead.  It's a pretty common error.  Try not to use special characters when naming fields.  Stick to standards.  I personnally always name fields with capital letters and numbers using identation like
    MYFORM.PLACE.NUMBER
    MYFORM.PLACE.ADDRESS
    MYFORM.SEX.MALE
    MYFORM.SEX.FEMALE
    This is really useful if you have lots of fields related to one another.  You can then apply methods to entire groups of fields in one simple line of code.
    For example this.getField("MYFORM").display = display.hidden would hide all four fields.  It works kind of the same way as folders unside your computer.
    Finally, "#" is generally used as widget identification.  I think this is what happened.  If you copy a field, it retains the same name and some of its charateristics but acrobat will assign them a number called widget.  The original field State will get the identification State#0 in the right pane as it is 0-based.  The copie will be identified State#1.  You must understand that the name of the field is still "State".  Some methods (actions you can code) let you determine the widget number for targetting a specific field from those you copied.  It is not the case here.  So for disambiguation, you should name your fields different name like STATE1 and STATE2, or STATE.1 and STATE.2 if you plan to use what I wrote about earlier.

  • I'm running firefox on a Macbook Air 10.6.8, and the bookmark folders in the bookmarks drop down menu don't open when I mouse over them or click on them. How do I fix this?

    I've run diagnostics on the mac air, reloaded firefox, and tried eerything I could think of. The 'show all bookmarks' page works perfectly- it's just the dropdown menu that has problems. All the folders have numerous items in them except for one- which only has two. That one works- the pop out menu for that folder comes out on the left side. All the arrows for the folders are on the right side (pointing right) of the of the drop down bookmark menu, pointing at the right edge of the computer screen. The dropdown menu appears on the right half of the screen, close to the edge. Strangely, my main computer is an iMac desktop, and my mozilla bookmarks dropdown menu folders open on top of the dropdown menu, not out on the side.

    I figgered it out. The resolution of the screen was set at 600x800, so the bookmarks dropdown menu took up more space than usual. The pop out folder contents didn't have enough room to pop out. With a resolution for a slightly smaller display the drop down bookmarks menu functions perfectly.

  • CSS Style drop down menu (contribute 3.11)

    Hi,
    I am having a problem viewing any styles in the styles drop
    down menu at the top of my page when editing.
    I am the administrator of the site and I set up the options
    like this:
    Administrator settings > Styles and fonts >
    Document level CSS (pull down)
    First 3 checkboxes checked, and show only CSS styles included
    in this CSS file (browsed and selected a css file with a single
    style).
    Checked the remainding 3 checkboxes
    No matter what I do I have not been successful in ever seeing
    a style of my own within this list.
    I have tried...
    1) Not using a secure site
    2) Allowing a different user on a different PC to attempt to
    create a new page
    3) Locating the stylesheet in many different locations
    4) Hardcoding the styles into the template
    5) Show all styles (which wouldn't work anyway since the
    pages are PHP based)
    6) Banging head violently against wall.
    I should mention that I am using a PHP based template which
    works fine apart from this styles drop down menu.
    Please please please help (asap)!
    Thanks,
    Dan.

    dotcom012 wrote:
    > I have a web site that uses a javascript and a style
    script to
    > control some drop down menus at the top, each page has
    to have this
    > in the <head> area. Is there a way to make say a
    CSS so that i can
    > say update that one page if say a link needs to be
    changed or added
    > so i don't have to go to each of the 120 pages to change
    the menu! So
    > far right now, i have to go to each page, go into the
    javascript code
    > and update the link or whatever. Is there an easier way?
    You may want to read this article, it shows how to use
    external files (CSS,
    SS-Includes, JS, etc):
    http://www.tjkdesign.com/articles/maintenance.asp
    HTH,
    Thierry
    Articles and Tutorials:
    http://www.TJKDesign.com/go/?0
    The perfect FAQ page:
    http://www.TJKDesign.com/go/?9
    CSS-P Templates:
    http://www.TJKDesign.com/go/?1
    CSS Tab Menu:
    http://www.TJKDesign.com/go/?3

  • Copy text fields and drop down menu fields

    Hi,
    Using LiveCycle Designer ES, I am making a simple form with some text fields and along with some drop-down menu fields.  With the resulting pdf, I need for one to be able to select the appropriate selection in the drop-down menus.  Then using cntl-a to select everything and then cntl-v to copy it into a text document.  This approach will only copy the text fields and not what is showing in the drop-down menu field.  Is there any way to solve this problem?  The end users computer has limited tools and software cannot be installed on it.
    Thank you for considering this issue and any help you may provide,
    ja

    Hi,
    I don't really know if the text field can be selected using Ctl+a, but if that is possible how about adding extra text field that is linked to pulldown menu?
    If the usage of the PDF is only for copying, then I would make a formcalc or javascript to combine all the text into one text field so that user only need to copy paste one field.

  • HT1420 i need to authorize my computer.  alt s and control b doesnt work.  there is no drop down menu

    I can't authorize my computer.  I did alt s and control b.  there is no drop down menu.  I have a windows computer.  I looked and tried everything Ive seen on community discussions.  apple's page didnt help

    Yay I found it!!!!  It is a little square box the is half black and half white with a arrow.   It is on the page that the music pictures moves to show the latest songs etc.   thank you diesel

  • Found 0 results for My browser is missing important items, the whole tool bar...., drop down menu to print, copy, work off line, file, save, book mark, history. I just installed latest foxfire on windows xp. Found some instructions but they called for usi

    Found 0 results for My browser is missing important items, the whole tool bar...., drop down menu to print, copy, work off line, file, save, book mark, history. I just installed latest foxfire on windows xp. Found some instructions but they called for using keys my computer doesn't have ( key in OSX There is no file, edit , history, help, tools, navigation, all the things your directions say to use. Also I always get hung up and the message a scrip is running. I don't know what thises scrips are but I sure don't need them.
    == This happened ==
    Every time Firefox opened
    == I just noticed it. It probably happened when I upgraded foxfire.

    <u>'''Can't see the Menu Bar'''</u> (File, Edit, View, History, Bookmarks, Tools, Help)?
    Turning the Menu Bar on and off is a new feature in version 3.6.
    ''(Linux & OSX see: [[Menu bar is missing]] )''
    <u>''Windows'' Method 1.</u> '''''Hold down''''' the key and press the following letters in this exact order: V T M
    <u>''Windows'' Method 2.</u> Press and release the key. The Menu Bar will be displayed; then choose ~~red:V~~iew > ~~red:T~~oolbars and click on ~~red:M~~enu Bar.
    The Menu Bar should now be displayed permanently, unless you turn it off again using View > Toolbars. Check mark = displayed, NO check mark = not displayed.
    See: http://support.mozilla.com/en-US/kb/Menu+bar+is+missing
    <u>'''Navigation Toolbar, Bookmarks Toolbar and other Toolbars'''</u> under View > Toolbars. Clicking on one of them will place a check mark (display) or remove the check mark (not displayed).
    <u>'''To display the Status Bar'''</u>, View, then click Status bar to place a check mark (display) or remove the check mark (not displayed).
    <u>'''Full Screen mode'''</u>
    http://kb.mozillazine.org/Netbooks#Full_screen
    Also see:
    ''' [[Back and forward or other toolbar buttons are missing]]'''
    '''[[Navigation Toolbar items]]'''

  • HT1341 Epson Stylus SX435W otherwise known as Workforce 435. Although Apple promises software drivers on-line attempts at downloading and ADDING repeatedly come up with drop down menu "...it is not currently available from the software server". Please hel

    Epson Stylus SX435W otherwise known as Workforce 435. Adding Driver to an iMac
    Although Apple promises software drivers on-line, my attempts at downloading and ADDING it to my iMac
    repeatedly come up with drop down menu "...it is not currently available from the  Software update server". Please help?
    I have downloaded all the Epson Printer Software but I cannot make the final step.

    Reset the printing system and then try adding the printer again.
    http://support.apple.com/kb/ht1341
    (You have installed, not just downloaded the Epson driver, right?)

  • CSS Drop down menu; how to align the right edge of drop down and parent menu?

    Hello everyone,
    I have a drop-down menu that is currently working well.
    The only change I need to make is to have the right edge of the  drop-down menu to align with the right edge of the parent menu. When you  hover over the menu, it currently "drops" down and to the right, with  the left edges aligned.
    I want the menu to "drop" down and to the left, so the right edges are aligned.
    I have tried fiddling with floats and absolute/relative positioning. I'm not sure what needs to be changed.
    Any help you can provide is greatly appreciated! I'm learning via "cut and paste", so please go easy on any terminology you may use.
    Thank you!
    Here is my code:
    .chromestyle{
         width: 100%;
         font-weight: bold;
         float: left;
         height: 29px;
    .chromestyle:after{ /*Add margin between menu and rest of content in Firefox*/
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
    .chromestyle ul{
    border: 0px solid #BBB;
    width: 100%;
    background: url(chromebg.gif) center center repeat-x; /*THEME CHANGE HERE*/
    padding: 4px 0;
    margin: 0;
    text-align: right; /*set value to "left", "center", or "right"*/
    .chromestyle ul li{
    display: inline;
    .chromestyle ul li a{
    color: #000000;
    padding: 4px 7px;
    margin: 0;
    text-decoration: none;
    border-left: 1px solid #DADADA;
    .chromestyle ul li a:hover, .chromestyle ul li a.selected{ /*script dynamically adds a class of "selected" to the current active menu item*/
    background: url(chromebg-over.gif) center center repeat-x; /*THEME CHANGE HERE*/
    /* ######### Style for Drop Down Menu ######### */
    .dropmenudiv{
    position:absolute;
    top: 0;
    border: 1px solid #BBB; /*THEME CHANGE HERE*/
    border-bottom-width: 0;
    font:normal 12px Verdana;
    line-height:18px;
    z-index:100;
    background-color: white;
    width: 200px;
    visibility: hidden;
    .dropmenudiv a{
    width: auto;
    display: block;
    text-indent: 3px;
    border-bottom: 1px solid #BBB; /*THEME CHANGE HERE*/
    padding: 2px 5px;
    text-decoration: none;
    font-weight: bold;
    color: black;
    * html .dropmenudiv a{ /*IE only hack*/
    width: 100%;
    .dropmenudiv a:hover{ /*THEME CHANGE HERE*/
    background-color: #0000ff;
    color: #fff200;

    Try this:
    .chromestyle{
         font-weight: bold;
         height: 29px;
    .chromestyle:after{ /*Add margin between menu and rest of content in Firefox*/
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
    .chromestyle ul{
    border: 0px solid #BBB;
    width:100%;
    background: url(chromebg.gif) center center repeat-x; /*THEME CHANGE HERE*/
    padding: 4px 0;
    margin: 0;
    text-align: left; /*set value to "left", "center", or "right"*/
    .chromestyle ul li{
    display: inline;
    .chromestyle ul li a{
    color: #000000;
    padding: 4px 7px;
    margin: 0;
    text-decoration: none;
    border-left: 1px solid #DADADA;
    .chromestyle ul li a:hover, .chromestyle ul li a.selected{ /*script dynamically adds a class of "selected" to the current active menu item*/
    background: url(chromebg-over.gif) center center repeat-x; /*THEME CHANGE HERE*/
    /* ######### Style for Drop Down Menu ######### */
    .dropmenudiv{
    position:absolute;
    top: 0;
    border: 1px solid #BBB; /*THEME CHANGE HERE*/
    border-bottom-width: 0;
    font:normal 12px Verdana;
    line-height:18px;
    z-index:100;
    background-color: white;
    visibility: hidden;
    text-align:left;
    .dropmenudiv a{
    width: auto;
    display: block;
    border-bottom: 1px solid #BBB; /*THEME CHANGE HERE*/
    padding: 3px;
    text-decoration: none;
    font-weight: bold;
    color: black;
    * html .dropmenudiv a{ /*IE only hack*/
    width: 100%;
    .dropmenudiv a:hover{ /*THEME CHANGE HERE*/
    background-color: #0000ff;
    color: #fff200;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How do I set the border preferences when formatting cells in Numbers?  After I make my selections and close the drop down menu, nothing happens.

    How do I set border preferences when formatting cells in Numbers?  When I use the drop down menu under Inspector, and set the preferences I want, a blue line shows up in the appropriate cell or cells to which I want to apply a border.  When I close the menu, the blue line goes away and there is no border.

    Jerry,
    I'm sorry for the intrusion on this thread. I had only made a simple comment, and then others responded. It was not my intention, especially since the original question was marked as answered. I will direct responses to any comments I make in fture postings that deviate from the OP's question to a newly created topic if I need a response, if not, I will just add a statement at the end of my comments to please not respond.
    As to your diagram, it is the ability to select the non-contiguous cells, and then be able to simulataneously select a specific part of the border edge, and then be able to change them all at once that I was after. That is something that is not possible in Numbers. It seems that in your diagram the "before", was attained by selecting each cell one at a time, and changing its border edge, one at a time. Then, in the "after", selecting the non-contiguous cells and changing the "Stroke" settings for the lines was attained simultaneously since that is possible in Numbers.
    If I am correct in how you attained the results in your diagram, that wasn't really what I was trying to achieve, since if the option were not grayed out, it would only select the same border edge on all selected cells. If I am incorrect, then I would like to have your input.
    Once again, sorry for allowing my comment to develop as it did.
    In God's Harmony

Maybe you are looking for

  • Sleep Resume Problems

    After I updated the firmware on my MacBook Pro today (2.2GHz i7 17") I am seeming to have a new problem. Whenever I plug my computer into my Cinema Display (with the computer closed) it won't wake up fully. The status light will come on, any external

  • Finder Preferences, hard disks cd's dvds, and ipods

    hello, I am a little confused at this. In finder preferences under the general tab tere is a menu "show these items on the desktop" and selection is -hard disks -cd,s dvds, and ipods -connected servers i have selected Hard disks, why isn't my externa

  • JVM Crash jshort_disjoint_arraycopy

    Hi all, I get these VM crashes which I can't figure out, can anyone provide information which can help me resolve this. This is a crash that has happened repeatedly lately. This is the message that I get : # An unexpected error has been detected by H

  • POWL refresh for calculated dates

    Hi,     When I use my POWL with calculated dates configured in POWL_QUERY.When I refresh the same in POWL Worklist after the next day this is not getting refer it is refreshing dates only when I click the calculated dates tab in POWL_QUERY. Regards,

  • Cannot update CR6.3

    I have downloaded and tried to update CR6.2 to 6.3 but I got an error say "Update is not applicable". I hope someone can help me out with this. Thank you so much.