How to set a pixel to certain value in a Graphic object.

Hello Every One
I want to set a certain point in a graphic context to a new Color value let say i have a point (x, y)=(100, 100)
and i have a JFrame window i can do like this
Graphics g = getGraphics();
Now i want to set the point(100, 100) to a new Color say red.
Please tell me how to do that.
Thanx Alot

I was wondering about this earlier today too...
you can use Graphics.drawLine with the startpoint and the endpoint equal to draw a dot on that pixel, but this seems like overkill.
/me joins csquadian waiting for an better answer

Similar Messages

  • How to set to-mode to Fixed Value and give a date in RSDV transaction

    Hi
             I am working in BI7.0 environment. I am deploying HR Reporting Project. I need to load data to HR Info Cube 0PAPA_C02, to do this I need to maintain validity slice (RSDV transaction) for the Info Cube. After first load I need to set "to-mode-'Fixed Value'" and give a date such as 31.12.9999.
            Can anyone please let me know the steps on how to set- to mode to Fixed Value in RSDV.
    Thanks

    Here's the basic steps to follow:
    1) Go to tcode RSDV, enter the InfoCube name (0PAPA_C02) and Execute.
    2) If there is data already in the InfoCube you will get a validity table with default validty dates from 0CALDAY.
    3) Click on the Display/Change button so that you're in change mode and edit the validity date to be 31.12.9999.
    4) In the To-Mode column, set the value to 'F' for fixed.
    5) Put the fixed date value (31.12.9999 in your example) in Fixed to time.
    6) Click on Save.

  • How to set group name as default value in People Picker in Infopath 2010

    How to set group name (shareoint Groupname)  as default value in People Picker in Infopath 2010

    Under the Developer tab in Infopath you can manage Loading Events, unfortunetly i dont have Visual Studio on this PC so i cant laborate, but i believe it's rather simple to figure out.
    Edit: Found a easier way, through Data > Default Values.

  • How to set a characteristic dependent on value of a keyfigure

    Hi folks,
    I'm facing the following problem:
    I need to create a solution that enables a user to set a characteristic to a values (Y or N).
    Because of the circumstances no direct access to RSA1 is possible.
    This is why I thought about BI  IP.
    The idea is now to plan a keyfigure with 0 and 1. Next step would be to use a planfunction in order to create the corresponding characteristic values:
    so like
    keyfigure
                       month Jan Feb
    customer A              1     0
    customer B              1    1
    char
    leads to                   Jan Feb
    customer A              N    Y
    customer B              N    N
    Any comment whether I'm on the right path?
    My Fox Formular looks like:
    DATA  FYEAR TYPE 0FISCYEAR.
    DATA FKNO_Y TYPE YKNOKUN.
    DATA FKNO_N TYPE YKNOKUN.
    DATA FREMSPER_Y TYPE YREMSPER.
    DATA FREMSPER_N TYPE YREMSPER.
    FKNO_Y = Y.
    FKNO_N = N .
    FREMSPER_Y = Y.
    FREMSPER_N = N.
    FYEAR = VARV(YMM0005E).
    FOREACH FYEAR.
       IF {YKNORESP, FYEAR, FKNO_Y, # } = 1.
          {YKNORESP, FYEAR, FKNO_N, Y} = 1.
      ELSE.
             {YKNORESP, FYEAR, FKNO_N, N} = 0.
      ENDIF.
    ENDFOR.

    Create 2 reports
    Report 1 having Month equal to @{Pv_Type}{Dummy}
    Report 2 having Year equal to @{Pv_Type}{Dummy} . Assuming Year in in CHAR datatype . If it is not then convert it to char.
    Now for your Year section use Report 1 in condition (row count greater than 0) and for your Month section use Report 2 in condition (row count greater than 0).
    Thanks

  • How to set AO channel to 0 value when VI stopped

    when a VI stopped, the AO channel stopped on the level it's get, how to set these analog output to zero when stop a vi?

    Hi!
    As a second option (and if your device supports it ) you could set the property "Idle Output Behavior"
    see here:  http://digital.ni.com/public.nsf/allkb/dc9d2ab6dfb1924e86257260000cc350
    and here: http://forums.ni.com/t5/LabWindows-CVI/Analog-output-behavior-after-the-task-has-stopped/td-p/655137
    Regards,
    Marco

  • How to set List and Tree Binding Value manually from backing bean?

    Dear All,
    I somehow found this code to work so that I could set a value on my bindings from a managed bean.
      public void setBindingExpressionValue(String expression, Object value)
        FacesContext facesContext = getFacesContext();
        Application app = facesContext.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = facesContext.getELContext();
        ValueExpression valueExp =
          elFactory.createValueExpression(elContext, expression, Object.class);
        valueExp.setValue(elContext, value);
      public class MyBean{
      private String employeeId;
      public void inAmethod(){
           setBindingExpressionValue("#{bindings.employeeId.inputValue}",
                                         getEmployeeId());
      }Now, I am thinking. What if I have a List or Tree Binding in my managed bean then how or what should I send
    to the expression value. Is it a List or Map?
    The first one was easy as it is just a string but how about when dealing with collection?
    JDEV 11g PS4
    Thanks

    Hi,
    a tree binding does not set the value of the tree but determines the selected node. The binding itself represents the collection model that shows the hierarchical tree structure. So your question does not apply to a tree
    Frank

  • How to set background color based on values in column grouping

    Hello,
    I have query
    select 1 as CustomerID,'Reality' as Type, 100 as Turnover
    UNION
    select 1 as CustomerID,'Budget' as Type, 120 as Turnover
    UNION
    select 2 as CustomerID,'Reality' as Type, 140 as Turnover
    UNION
    select 2 as CustomerID,'Budget' as Type, 120 as Turnover
    I have matrix, where in rows are customers, there is columngroup based on field Type and in details are summaries of Turnover. I need to change background color of Reality field, when lower than Budget. How can I do that please ?

    Hi volyn,
    After testing the issue in my own environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
    Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
    DIM PreviousValue AS Decimal
    Dim CustomerID AS String = ""
    Public Function  GetPreviousValue(byval Val as Decimal, byval CusID as string)  as Decimal
    DIM Local_PreviousValue AS Decimal
    IF CustomerID <> CusID THEN
    CustomerID  = CusID 
    PreviousValue  = val
    Local_PreviousValue  = 0
    ELSE
    Local_PreviousValue =  val - PreviousValue 
    PreviousValue  = val
    END IF
    return Local_PreviousValue 
    End function
    Click the cell which contains [Sum(Turnover)] value, modify the expression of BackgroundColor property to like this in the Properties Window: 
    =iif(Code.GetPreviousValue(Fields!Turnover.Value,Fields!CustomerID.Value)<0,"Brown","White")
    In this scenario, you can change Brown color to any color you like. The following screenshot is for your reference (I added some data to make it more clearly):
    If you have any other questions, please feel free to ask.
    Thanks, 
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to set windows at a certain size in Lion ?

      Hi Guys
      this is something i have been having an uphill struggle trying to get right - to say the least !!..
      in Snow Leopard one could only ''resize'' a window by pulling on it's corners ( NOT a limitation in my book.. )  but when you closed the window & later opened it again, it remained the size it was when you last closed it
      now with Lion one can ''resize'' the windows by pulling anywhere ( just like Windows - HURRAY !?.. ) BUT when you close it & open it again later, Lion resizes it forcing me to - AGAIN.. - size it back to my preferences/needs and to me THAT my friends IS a SERIOUS limitation to my efficiency
    on my 27'' iMac i like my windows to be roughly  8'' tall X 10'' wide, that combined with my file & folder's size gives me a nice working space, showing most of that window's content WITHOUT scrolling, etc.... MOST IS clearly displayed to see, what could be easier than that ?
    the PROBLEM is that this happens 10, 15 or even 20 times a day, WASTING my time & effort in the process - for NOTHING !!
    & that's what drives me nuts : constantly resizing windows ? in my neck of the woods there ARE better things to do.....you know what i mean ? this IS MOST frustrating given the pointlessness of the effort wasted
    what can i say ? i'm a lazy bugger who doesn't enjoy repeating the same task  OVER & OVER again - anyone has a suggestion on how to avoid this ?
    i'd truly appreciate a solution for this
    many thanks

    Hello Pankaj
    You will find a solution for your problem in sample report <b>BCALV_EDIT_03</b>. If you do the error handling in the event handler method for DATA_CHANGED then the cursor will point to the field containing the faulty value.
    Here is part of the report's header documentation:
    program bcalv_edit_03.
    * Purpose:
    * ~~~~~~~~
    * In this example the user may change values of fields
    * SEATSOCC (occupied seats) and/or PLANETYPE. The report checks
    * the input value(s) semantically and provides protocol
    * messages in case of error.
    * To check program behavior
    * ~~~~~~~~~~~~~~~~~~~~~~~~~
    * Change values of the column "occupied seats" or "Planetype" or
    * both (in the same line). Try to provocate errors.
    * Click on the check symbol or press return to initiate checking.
    * (ALV also checks input before any functions like sorting,
    * filtering or doubleclick are processed. These functions are
    * only active if the input does not contain any errors).
    * The ALV Grid Control first checks if the input is correct
    * according to DDIC-Information (Type, lenght). Then semantic
    * checks are made by the application using event handler method
    * HANDLE_DATA_CHANGED.
    Regards
      Uwe

  • How to set a default tabular form value?

    I am trying to set a default value for a tabular form.
    In Tabular Form Element:
    ========================
    Display as: Date Picker
    Formet: Date Picker (DD-MON-RR)
    Default Type: Item (application or page item name)
    Default P2_DATE
    My item P2_DATE is set as:
    ==========================
    Date Picker (DD-MON-RR)
    However when I try to add a row with a default date I get this error:
    report error:
    ORA-01790: expression must have same datatype as corresponding expression
    Any ideas?
    Regards,
    Pawel.

    Sorry for spamming but found a solution:
    which was to change the type into PL/SQL Expression like so:
    to_date(:P301_PROJECT_XFR_DATE,'DD/MM/YYYY')
    This is the format I used in P2_DATE...
    Regards.

  • How to set a global configuration for Value Interaction

    Hi there
    i have this problematic situation about some of my dashboards, cause i need to set the same configuration for all of them in the part of the value interaction,
    some of there have in the "default situation" drill and others have "navigation"
    exist a config for this?
    regrats

    Hello Pavel,
    >> … and then on the login page I created a process …
    A typical APEX login page includes a process called Clear Page(s) Cache, with a sequence of 30. If the process you have create has a higher sequence (>30) it will see a null page values as they have been cleared already.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • How to set JTextField to show certain map scale (e.g. 1/2000)

    Hi,folks. I have a JTextField instance. How can I set the format to only allow user to only type the map scale(e.g. 1/2000). I can only use the JTextField component. Thank you in advance.

    I think the regex you're looking for is"1/[1-9]\\d*"Note that in the regex you posted"1[\\]\\d*"the closing bracket is quoted by the backslash, causing the error you mentioned. Not that you needed a backslash there anyways.
    You can try this, but note that since replace(...) invokes remove(...) and replace(...), pasting an apparently valid String will not succeed if the slash is part of the replacement. Also that setText or pasting are the only ways to set the initial content as you won't be able to type it in one character at a time.import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.PlainDocument;
    public class ScaleFactorTextField {
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new ScaleFactorTextField().makeUI();
       public void makeUI() {
          JTextField textField = new JTextField(10);
          textField.setDocument(new PlainDocument() {
             final Pattern p = Pattern.compile("1/[1-9]\\d*");
             @Override
             public void insertString(int offs, String str, AttributeSet a)
                   throws BadLocationException {
                String newText = getText(0, offs) + str +
                      getText(offs, getLength() - offs);
                if (isValidText(newText)) {
                   super.insertString(offs, str, a);
             @Override
             public void remove(int offs, int len) throws BadLocationException {
                String newText = getText(0, offs) +
                      getText(offs + len, getLength() - offs - len);
                if (isValidText(newText)) {
                   super.remove(offs, len);
             @Override
             public void replace(int offs, int len, String text,
                   AttributeSet attrs) throws BadLocationException {
                String newText = getText(0, offs) + text +
                      getText(offs + len, getLength() - offs - len);
                if (isValidText(newText)) {
                   super.replace(offs, len, text, attrs);
             private boolean isValidText(String text) {
                Matcher m = p.matcher(text);
                return m.matches();
          textField.setText("1/20000");
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.add(textField);
          frame.pack();
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
    }db

  • How to set the caption text of a node with user object.

    This is my problem for two days below is my sample code. I need to associate object with the tree node but the node is displaying the toString() value of the object. It should display the text I wanna see.
    Please help. I was from the JSP world so Swing is quiet new to me, only this year I got again a project in swing.
    TreeMap treemap = new TreeMap();
    treemap.put("3","3");
    treemap.put("5","4");
    treemap.put("4","4");
    treemap.put("1","1");
    treemap.put("2","2");
    DefaultMutableTreeNode nodetable = new DefaultMutableTreeNode(treemap,true);
    DefaultTreeModel model = (DefaultTreeModel)jtree.getModel();
    model.insertNodeInto(nodetable, nodetop,nodetop.getChildCount());

    I have created a subclass of DefaultMutableTreeNode, I just have one question with my Default Constructor, is it correct? Suppose to be it should be super(Object userObject ,boolean allowChildren)?
    But when I do that it does not compile.
    Please correct me if I am wrong. I suspect my contructor inside code super() is not enough the parameters got lost. (btw) i will give you the dukes, please just verify my code.
    Thanks.
    class MyDefaultMutableTreeNode extends DefaultMutableTreeNode{
    public String caption="";
    public MyDefaultMutableTreeNode(Object userObject ,boolean allowChildren){
    super();
    public void setCaptionString(String str){
    caption = str;
    public String toString(){
    return caption;
    }

  • How to set pixels for smoothest -outline, in a design? I am using PhspCS5 TRIAL Grateful for help!

    First, I am not an advanced digital artist rather know (just)basic tools and am quite good with those over the years however, have a new Mac and better
    visibility for sure and have a TRIAL version of PSHP CS5 Extended; what I am asking is: how to set the pixels...to acheive the smoothest outline eg. I
    designs for greeting cards and now working on a Xmas tree, with gold stars, they look best outlined (vy-light=blk) but when I ZOOM IN I see the 'wavy lines
    of the pixels, that are set on 'square'.  I wish to know how to set the pixels* #1 and then as far as colours, when I pick a yellow (there are many!yellows !!)
    and use my Intuos pen, 'tap tap tap' on the designs (yellow of the star) it does NOT register ....(it did on my other computer and older CS4).  So going
    back, to my colour swatches, to ...remember just which yellow I picked...ha ha....can be: "not so fast!"  
    I will be buying this on Subscription at the end of the trial and my bet is that the colour picker/will work on the purchased version when I 'tap tap' to pick up the
    same colour II had chosen.  Wouldn't it be good to have a monitor of sorts that tells you, what colour(s)one has been using, when you NEED to know, to go
    on with the 'design' say after a break for tea etc.  ?????  (    :
    I save my designs when done JPEGs, and see now there is a JPEG 2000...I have no idea what that is all about.  I save (1)pdf and one jpeg.  Hope this sounds
    like what  one 'does' ...when one knows far more than I do.
    And lastly,  what program or tool, can one use to put a 'frame' (border) around a eg: 5 x 7 design (again, my goal is for my designs for Greeting Cards.  Is there
    another Adobe products I should have for that.  Free hand hasn't worked out so well, so far.
    I am in advance, so grateful to you - whomever you may be, for your help.  I am on my last 'hoorah' path now hoping for success soon....I am a senior of 71 yrs
    and so feel I need to really 'get going' and learn these basics to assure my chances of success, at least. Merci, Danke & Thank You ! CDW

    Please post in the Photoshop forum.
    http://forums.adobe.com/community/photoshop
    Bob

  • How to set value of textinputbean in am

    hi guys,I have an item on my oaf page that is non data base item and i want to set its value in AM.Actually I am calling a DB procedure in AM that return me a value now i want to set this value in TextinputBean.but i dont know how to set a non database item value.
    Earlier i was setting database item values by getting vo and its row.
    Please Urgent

    You can't change bean properties in AM rather you have to use controller(CO).
    Call the AM method from controller and get the value. Set the value of the bean in the controller.
    Setting the value should only be done in processRequest.
    If your use case doesn't permit to call the AM method from processRequest then call the AM method from processFormRequest and call forwardImmediatelyToCurrentPage method which will call the processRequest and set the value of the bean in processRequest.
    For sample code have a look at the forum entry
    https://forums.oracle.com/thread/2554198
    Regards,
    Peddi.

  • How to enter values for an Info-object Manually.

    Hi
    I have to enter certan values manually in the customised info-object which are not available in the
    BW at the moment.
    If I go via SE11 I am only getting change option.
    If I go via SM30 it says The maintenance dialog for ****** is incomplete or not defined.
    How can I enter certain values to this info-object.
    Please advise.
    Many thanks,
    Kate.

    Hi
    Use transaction rsdmd to maintain infoobject values - or right click any infoobject an select maintain master data.
    Regards,
    Beat

Maybe you are looking for