Painting on a part of an Button(AWT): Is it possible?

Hi all!
I am displaying several Buttons on an Panel. When mousepressed on some of the buttons, more buttons will display on the panel. FOr this reason, I want to make sure the user can see which Buttons can display more buttons, and for this reason I want to draw a small rectangle on the top-left corner on these Buttons. The rectangle will contain a pluss-sign or a minus-sign, depending if the Button is pressed or not.
(like the expanding or collapsing thing in i JThree).
I know I can implement this with Image or ImageIcons, but I don't want to use them.
Is it possible to do this, and if it is, can you give me some hint on how to implement this? Remember, I am using AWT not Swing.
Regards trondal

Create your own class extends Button, in the paint method call super.paint(graphics) and then draw what you like.
Noah

Similar Messages

  • Using Outlook Web App Web Parts in Exchange Server 2013 - OWA ? Possible?

    Using Outlook Web App Web Parts in Exchange Server 2013 - OWA ? Possible?
    We recently upgraded from Exchange 2010 to Exchange 2013.
    The links that used OWA Web parts have completely stopped working and generate the " :( something went wrong contact your help desk" screen for domain Authenticated users other than myself. The links accessed content of a Shared Account of which
    I am an owner and can set the necessary permissions using the Outlook 2013 client.
    Using the example from the link provided below we were able to provide calendar access to all authenticated users in our area. The link for calendar still works for me but for noone else. Additionally, all navigation menus are missing when I use this link.
    <server>/owa/<SMTP address>/?cmd=contents&module=calendar&view=weekly name
    Another crafted link provided web access to our group's task list. This has completely stopped working for anyone including myself. However, when I use "open another mailbox" I am able to navigate to the needed pages.
    <server name>/owa/<SMTP address>/?cmd=contents&module=tasks
    These links were crafted using advice provided from this provided link.
    technet.microsoft.com/en-us/library/bb232199(v=exchg.141).aspx
    Is it still possible to use Outlook Web App Web Parts in Exchange Server 2013 - OWA?
    Or
    Is this a misconfiguration of some sort?
    My IT support has given up and closed out the ticket stating that maybe Microsoft will fix this someday...

    Hello,
    At present, there is no official article to verify whether we can use Outlook Web App Web Parts in Exchange Server 2013. In exchange online, the Outlook Web App Parts is supported.
    Cara Chen
    TechNet Community Support
    Hi, you said this feature is supported in Exchange Online (I understand you're referring to Office 365). Can you please point me to some documentation as I was trying to use it with my E3 account and it doesn't seem to work?
    What I'm trying to acomplish is something similar to our old URL (Exchange 2010) in Office 365:
    https://ourserver.mydomain.com/owa/[email protected]/?cmd=contents&module=calendar&view=monthly
    The best I can do in Office 365 is this:
    https://outlook.com/owa/mydomain.com/[email protected]/#path=/calendar
    But it's clearly not the same and Office 365 ignores all the information I add to the URL. I would greatly appreciate something in the line of the document referred by 'MarquetteENG' (technet.microsoft.com/en-us/library/bb232199(v=exchg.141).aspx)
    Thanks.
    Paulo.
    Paulo Dias - IT Pro Evangelist

  • Painting JLIst cell part 1

    Hi,
    I previously post a question on the forum but I believe my question may be confused, so I would like to rephrase my problem again.
    I need to come up with a program to monitor products/goods for my operation.
    The program should let me enter more products or delete them, one at a time.
    Once entered, a product should be highlighted or painted in “Red” or default color, indicating it needs attention.
    I want to enter several products before coming to take a look at individual product though I need to enter more products during manufacture operation.
    Once I finish considering a product in the list, I would like to toggle it to change the color to normal, indicating this product does not need attention.
    During manufacture operation, should the problem arise with any product(s), I would like to toggle the product(s) background to Red again, indicating they needs attention again.
    I found that ListDemo.java in the Sun (SDN) website is very close to my need but I need help to paint/highlight the background once I select the product.
    Right now, if I leave the previous selection for the new selection, the previous one will lose the hightlight. I need them to stay permanent no matter where I click until I re-elect it.
    I post part 2 of this topic, containing only java code I borrowed from Sun, just want to make myself clear. Please see part 2 next to this one.

    Sorry for the inconvenience, but I got error message for posting message that is more than 7,500. Here is the code I borrowed from Sun website:
    Part 1:
    package components;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    /* ListDemo.java requires no other files. */
    public class ListDemo extends JPanel
    implements ListSelectionListener {
    private JList list;
    private DefaultListModel listModel;
    private static final String hireString = "Hire";
    private static final String fireString = "Fire";
    private JButton fireButton;
    private JTextField employeeName;
    public ListDemo() {
    super(new BorderLayout());
    listModel = new DefaultListModel();
    listModel.addElement("Debbie Scott");
    listModel.addElement("Scott Hommel");
    listModel.addElement("Sharon Zakhour");
    //Create the list and put it in a scroll pane.
    list = new JList(listModel);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSelectedIndex(0);
    list.addListSelectionListener(this);
    list.setVisibleRowCount(5);
    JScrollPane listScrollPane = new JScrollPane(list);
    JButton hireButton = new JButton(hireString);
    HireListener hireListener = new HireListener(hireButton);
    hireButton.setActionCommand(hireString);
    hireButton.addActionListener(hireListener);
    hireButton.setEnabled(false);
    fireButton = new JButton(fireString);
    fireButton.setActionCommand(fireString);
    fireButton.addActionListener(new FireListener());
    employeeName = new JTextField(10);
    employeeName.addActionListener(hireListener);
    employeeName.getDocument().addDocumentListener(hireListener);
    String name = listModel.getElementAt(
    list.getSelectedIndex()).toString();
    //Create a panel that uses BoxLayout.
    JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new BoxLayout(buttonPane,
    BoxLayout.LINE_AXIS));
    buttonPane.add(fireButton);
    buttonPane.add(Box.createHorizontalStrut(5));
    buttonPane.add(new JSeparator(SwingConstants.VERTICAL));
    buttonPane.add(Box.createHorizontalStrut(5));
    buttonPane.add(employeeName);
    buttonPane.add(hireButton);
    buttonPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    add(listScrollPane, BorderLayout.CENTER);
    add(buttonPane, BorderLayout.PAGE_END);
    class FireListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    //This method can be called only if
    //there's a valid selection
    //so go ahead and remove whatever's selected.
    int index = list.getSelectedIndex();
    listModel.remove(index);
    int size = listModel.getSize();
    if (size == 0) { //Nobody's left, disable firing.
    fireButton.setEnabled(false);
    } else { //Select an index.
    if (index == listModel.getSize()) {
    //removed item in last position
    index--;
    list.setSelectedIndex(index);
    list.ensureIndexIsVisible(index);
    //This listener is shared by the text field and the hire button.
    class HireListener implements ActionListener, DocumentListener {
    private boolean alreadyEnabled = false;
    private JButton button;
    public HireListener(JButton button) {
    this.button = button;
    //Required by ActionListener.
    public void actionPerformed(ActionEvent e) {
    String name = employeeName.getText();
    //User didn't type in a unique name...
    if (name.equals("") || alreadyInList(name)) {
    Toolkit.getDefaultToolkit().beep();
    employeeName.requestFocusInWindow();
    employeeName.selectAll();
    return;
    int index = list.getSelectedIndex(); //get selected index
    if (index == -1) { //no selection, so insert at beginning
    index = 0;
    } else {           //add after the selected item
    index++;
    listModel.insertElementAt(employeeName.getText(), index);
    //If we just wanted to add to the end, we'd do this:
    //listModel.addElement(employeeName.getText());
    //Reset the text field.
    employeeName.requestFocusInWindow();
    employeeName.setText("");
    //Select the new item and make it visible.
    list.setSelectedIndex(index);
    list.ensureIndexIsVisible(index);
    }

  • KeyEvent on dynamically generated Buttons - AWT

    hi,
    I have posted the below in Swing forum and was adviced to post this type of questions in AWT forum. I got a solution jbutton.setMnemonic(int keycode) and that can be used only in JButton, I believe.
    Is there anything similar we can use in Button. Below is the post. Could someone please help ?
    I have an app, which builds <n> number of buttons reading from an XML file.
    Below is the code that generates the buttons
      Button btn[];
         for (int i=0; i<strBtnValue.length; i++) {
            btn[i] = new Button(strBtnValue[1]);
    btn[i].setForeground(getColor(strBtnForeground[i][1]));
    btn[i].setBackground(getColor(strBtnBackground[i][1]));
    btn[i].setBounds(intX_btn, intY_btn, intW_btn, intH_btn);
    intX_btn = intX_btn + 140;
    btn[i].setFont(strBtnFont);
    btn[i].addKeyListener(this);
    add(btn[i]);
    public void keyReleased(KeyEvent e) {
    int keyCode = e.getKeyCode();
    if (keyCode == 68) { // key D is pressed
    System.out.println("Released D");
    }I need to assign 'keyboard D' to a button. And when 'D' is pressed, i want to get the attributes for that button. Could anyone shed some light ? Let me if this is not a clear explanation.
    Thanks in advance.
    Edited by: Sathanga on Feb 13, 2008 7:00 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Is this what you're looking for?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ButtonTest extends JFrame implements KeyListener {
         public ButtonTest() {
              JPanel cp = new JPanel(new BorderLayout());
              Button b = new Button("Button 1");
              b.addKeyListener(this);
              cp.add(b, BorderLayout.LINE_START);
              b = new Button("Button 2");
              b.addKeyListener(this);
              cp.add(b, BorderLayout.LINE_END);
              setContentPane(cp);
              setTitle("Button Test");
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
         public void keyPressed(KeyEvent e) {
         public void keyReleased(KeyEvent e) {
              if (e.getKeyCode()==KeyEvent.VK_D) {
                   Button b = (Button)e.getSource();
                   String buttonText = b.getLabel();
                   System.out.println("'D' key released for button: " + buttonText);
         public void keyTyped(KeyEvent e) {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        new ButtonTest().setVisible(true);
    }

  • On TV the left part of shape button disappear

    Hi to everyone, please a little help...
    This is the problem: I choose a shape for my button in DVDSP, try with the simulator, all is OK, try with the DVD player on my iMac, all is OK, but when I insert the DVD in my player on TV (PAL) when the button is highlited the left part disapper.... just like incomplete.
    I tryed another shape button but is the same thing ... Why?
    Thanks to all

    It could be that it is outside title/action safe areas.
    In menu/settings pulldown (right beneath the right side of the red box here http://dvdstepbystep.com/layofland.php), select to show title safe and action safe.
    Title safe guides (everything will show up within those lines), action safe (area from title safe to action safe usually shows up) and then outside action safe should not be counted on.

  • DC Properties Public Parts Tab Add Button is in diable mode

    Hi All,
    I am unable to add public parts to my webdynpro DC because ADD button is in disable mode
    Can any one please help me
    If you want you can see with attachments.
    Thanks In Advance.

    create the project first

  • Help with Live Paint - filling in part of an image

    I have imported a dfw image into illustrator. It's a black and white image of an object similar to the one below:
    I want to paint the areas around the perimeter of the image black so that it looks like it has a large black outline (the areas that contain the X's). I've been able to do it on a few but some of the images, when I open them, the live paint selects only inner areas that I don't want painted. I can't figure out how to change the paths to the ones I want.
    I import the image, select all, Object>Live Paiint>Make. Then I set the fill to black. In this example, there are 3 stripes on each pants leg and the only thing Live Paint will select is the outermost stripe. I've tried Object>LivePaint>Expand then reselect the Live Paint Buckeet and click the image when it says, "Click to make Live Paint Group" but nothing changesso that I can paint the desired areas.
    I've checked the image closely to ensure there are no breaks in the paths and I've just spent the last 4 hours reading instructions and watching videos but no help. I'm braind new ti Illustrator and must be missing something bassic but don't know what. Any help would be appreciated. I'm stumped.

    I should have posted this hours ago. As soon as I did I found the answer. For anyone else with this problem, Select the image then, before using the Live Paint Bucket, select Object>Flatten Transparacy. Then, when you select the live paint bucket, it will ask for you to set the paths and after you do, it'll work just fine.

  • How to concatenate 2 outcomes in the action part of a button?

    I have a button that has an actionListener and an action and in action I want to concatenate two outcomes like this:
    action="#{bindings.Execute.outcome bindings.Commit.outcome}"
    I don't know how to concat the two. Execute updates an LOV , commit commits. I want them both to be executed....

    Wendy, have you considered double-clicking on button in the visual designer and allowing JDeveloper to create an action for you (stub) in the backing bean? From there you could even call these two programs using the method of calling things in the binding layer from the bean using java calls and passing the same EL expressions. This method is spelled out in the ADF Developer's guide. From that point you can concatenate the outcomes using the java concatenation operator.

  • Part of page is flex , is it possible

    Hello,
    I wonder if I can make only one part of the page is flex and
    the rest is HTML, for example only the user input form is flex, or
    only the navigation , could be done ? how ?
    Thanks

    You can create an HTML page and then incorporate the text FB
    auto-generates for you in the HTML file for your FB application. I
    added this right after the <body> tag: <h1
    align="center">UTC to PST Date String Converter</h1>
    The HTML file FB auto-generates has additional content you
    probably would want, like automatically informing the user to
    upgrade the Flash plug-in if necessary to see your content.

  • Toplink Expression - edit button not showing all possible field names

    Hi,
    i use Jdev 11g (11.1.1.0.1) with TopLink. I created a Toplink mapping and everything works well. I now want to create another named query with a selection criteria, but the Edit-Button in the Expression Builder for the selection criteria isn't working well. If i click the button nothing happens, but JDev freezes for about 15 sec. Anyone else with this problem ?
    Thanks,
    Friedrich

    You should put all your menus in the root menu.
    <?xml version="1.0" encoding="utf-8"?>
    <openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id ="root-menu" label="Exit">
    <item label="Reboot">
    <action name="Execute">
    <execute> sudo /sbin/shutdown -r now </execute>
    </action>
    </item>
    <menu id="apps-accessories-menu" label="Accessories"/>
    <menu id="apps-editors-menu" label="Editors">
    <item label="Scite">
    <action name="Execute">
    <command> scite </command>
    <startupnotify>
    <enabled> yes </enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    </menu>
    </openbox_menu>

  • Radio button in a Table -Only one row/radio button selection to be possible

    Hi experts,
    I have a requirement from customer to have a radio button inside a table of a WebDynpro ABAP application. For example, a table containing list of mobile numbers.
    The columns has
    Mobile Model, Cost, Company name, and a radio button named choice.
    Only one record and hence one radio button can be chosen at a given time.
    When the user clicks on the radio button choice corresponding to the row of the mobile of his choice, the row should get lead selected .
    When the user chooses a different choice radio button (corresponding to another mobile) the old radio button choice should get deselected, new row and its radio button should be lead selected.
    Can you give me the code how to deselect the remaining radio buttons when a user selects on one Radio button

    Hi Sandeep ,
    Have a look at the events of table UI element and its paramaters , Here's the link.
    [Link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm]
    The event 'Onselect' or 'OnLeadSelect' provides 4 standard paramaters , out of which , OLD_LEAD_SELECTION/OLD_ROW_ELEMENT is one of them.
    So you could use this element and set the attribute value (Which is bound to the radio button) to abap_false.
    Although I am not sure as to which event ight trigger ( ON_LEAD_SELECT / ON_SELECT ).:)
    Thanks,
    Aditya.

  • BADI / Exit ME51N SAVE button, modify items is possible

    Hi all,
    I have to save certain information in a PR items on having touched the button SAVE, have seen that passes for several exits, have the parameters type import.
    The last exit for the one that passes is the EXIT_SAPLMEREQ_006, but it does not have parameters.
    Would they know some exit or badi from where I could modify the items data on having touched the button SAVE?
    Thanks.

    Hi Gautham,
    I have already tried all the exits of MEREQ001.
    But I see no any exit where can modify the data when press SAVE.
    Thanks.

  • Retouch part of a movie in motion 5 possible?

    Hello,
    must retouch part of a movie, similiar like Photoshop for images, is that possible with motion 5? Furthermore the scenes have little movement. Or might another software better?

    Don’t know about a “stamp” for retouching ?
    Try a rectangle mask, or else, with a feathered edge
    to create the illusion of a seamless border.
    http://www.youtube.com/watch?v=JLyNViaeHEM
    Otherwise, duplicate your layer, then mask out what you like to use on the top layer,
    and move it into position to cover the problem on the bottom layer…

  • Buttons in Question slides, possible?

    Hello. I'm trying to get around this. So far putting buttons in hasn't worked as it won't allow it, putting them in a master slide wont work as it wont allow it and really the only possibly I see that might work is an SWF button. My problem is (even though I know AS3) is I don't know where to start, and I am unsure how to apply my Captivate advanced actions to an SWF button, and to let it know what variables are set at and when they change.
    Maybe there is an easier way? Can this be achieved at all, without using a crazy javascript menu overlay?
    Thank you.

    Hello,
    Have been blogging and writing some articles about constructing Question slides. There are some caveats: drag-and-drop is not possible out of the box, but you can have a fine Widget for that. It is a lot more work than using the default Questions. And you have to watch the scores closely, especially if you have to report to a LMS using SCORM. But if I have enough time I will always use my own questions.
    Lilybiri

  • I need to batch process images to 800x800px without cropping off any part of the images.  Is this possible in photoshop?

    I have tried processing these through Bridge and image processor, but can only limit either of the height or width to the 800px size.  I need the final images to be 800x800px, and don't mind if they have a white border to achieve this.

    thanks for that I've cracked it

Maybe you are looking for