Java3D Picking Problem

Hi, I have problem with picking. I have two shapes 3D (for example) and if there are separately (not hidden) picking is OK. But when I rotate them using myMouseRotate or rotation.rotY(angle) so one of them is hiden, it's always pick me only one of them, even it's hidden. I use pickClosest() method. What's wrong?
Please help me
pozdrawiam
Wojtek

It doesn't work because I need to pick one of this shape. I think that it's something with rotation... Check this simply full code below. Press any key to rotate. At the begining you pick ColorCube and it' ok. But if you rotate 180 degrees you will pick ColorCube again and it's wrong. Additionally if you change "angle = 3.14/2;" to "angle = 3*3.14/2;" you can pick Sphere but can't pick ColorCube.
How can I solve it?? Maybe when I rotate something is change with direction of pick rays.
Code - Pick_1.java:
import com.sun.j3d.utils.picking.*;
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import java.awt.event.*;
import java.awt.*;
import com.sun.j3d.utils.behaviors.mouse.*;
import java.util.Enumeration;
public class Pick_1 extends MouseAdapter {
     private PickCanvas pickCanvas;
     static double angle = 0.0;
     public class SimpleBehavior extends Behavior{
     private TransformGroup targetTG;
     private Transform3D rotation = new Transform3D();
     // private double angle = 0.0;
     // create SimpleBehavior
     SimpleBehavior(TransformGroup targetTG){
     this.targetTG = targetTG;
     // initialize the Behavior
     // set initial wakeup condition
     // called when behavior beacomes live
     public void initialize(){
     // set initial wakeup condition
     this.wakeupOn(new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
     // behave
     // called by Java 3D when appropriate stimulus occures
     public void processStimulus(Enumeration criteria){
     // decode event
     // do what is necessary
     angle += 0.1;
     rotation.rotY(angle);
     targetTG.setTransform(rotation);
     //rotation.set(new Vector3f(-0.1f, 0.0f, 0.0f));
     //targetTG.setTransform(rotation);
     this.wakeupOn(new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED));
     public Pick_1()
     Frame frame = new Frame("Box and Sphere");
     GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
     Canvas3D canvas = new Canvas3D(config);
     canvas.setSize(400, 400);
     SimpleUniverse universe = new SimpleUniverse(canvas);
     BranchGroup group = new BranchGroup();
          TransformGroup objTransform = new TransformGroup();     
     objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
     objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
     group.addChild(objTransform);     
     /*      MouseRotate myMouseRotate = new MouseRotate();
     myMouseRotate.setTransformGroup(objTransform);
     myMouseRotate.setSchedulingBounds(new BoundingSphere());
     group.addChild(myMouseRotate);
     MouseTranslate myMouseTranslate = new MouseTranslate();
     myMouseTranslate.setTransformGroup(objTransform);
     myMouseTranslate.setSchedulingBounds(new BoundingSphere());
     group.addChild(myMouseTranslate);
     MouseZoom myMouseZoom = new MouseZoom();
     myMouseZoom.setTransformGroup(objTransform);
     myMouseZoom.setSchedulingBounds(new BoundingSphere());
     group.addChild(myMouseZoom);
     SimpleBehavior myRotationBehavior = new SimpleBehavior(objTransform);
     myRotationBehavior.setSchedulingBounds(new BoundingSphere());
          group.addChild(myRotationBehavior);
     //create a sphere
     Vector3f vector2 = new Vector3f(0.6f, 0.0f, 0.0f);
     Transform3D transform2 = new Transform3D();
     transform2.setTranslation(vector2);
     TransformGroup transformGroup2 = new TransformGroup(transform2);
     Appearance appearance = new Appearance();
     appearance.setPolygonAttributes(
     new PolygonAttributes(PolygonAttributes.POLYGON_LINE,
     PolygonAttributes.CULL_BACK,0.0f));
     Sphere sphere = new Sphere(0.1f,appearance);
     transformGroup2.addChild(sphere);
     objTransform.addChild(transformGroup2);
     // create a color cube
     Vector3f vector = new Vector3f(0.3f, 0.0f, 0.0f);
     Transform3D transform = new Transform3D();
     transform.setTranslation(vector);
     TransformGroup transformGroup = new TransformGroup(transform);
     ColorCube cube = new ColorCube(0.1);
     transformGroup.addChild(cube);
     objTransform.addChild(transformGroup);
     //dodatkowo przesuniecie od razu o 90 stopni
          Transform3D obrot = new Transform3D();
               angle = 3.14/2;
          obrot.rotY(angle);                                   //!!!!! takie przesuniecie dobrze dziala
     objTransform.setTransform(obrot);                //WIEC O CO CHODZI!!!!!!!!!!!!!!!
     universe.getViewingPlatform().setNominalViewingTransform();
     universe.addBranchGraph(group);
     frame.addWindowListener(new WindowAdapter() {
     public void windowClosing(WindowEvent winEvent) {
     System.exit(0);
     frame.add(canvas);
     pickCanvas = new PickCanvas(canvas, group);
     pickCanvas.setMode(PickCanvas.BOUNDS);
     canvas.addMouseListener(this);
     frame.pack();
     frame.show();
     public static void main( String[] args ) {
     new Pick_1();
     public void mouseClicked(MouseEvent e)
     pickCanvas.setShapeLocation(e);
     PickResult result = pickCanvas.pickClosest();
     if (result == null) {
     System.out.println("Nothing picked");
     } else {
     Primitive p = (Primitive)result.getNode(PickResult.PRIMITIVE);
     Shape3D s = (Shape3D)result.getNode(PickResult.SHAPE3D);
     if (p != null) {
     System.out.println(p.getClass().getName());
     } else if (s != null) {
     System.out.println(s.getClass().getName());
     } else{
     System.out.println("null");
     /*pickCanvas.setShapeLocation(e);
     PickResult result = pickCanvas.pickClosest();
     if (result == null) {
     System.out.println("Nothing picked");
     } else {
     // PickIntersection pi = result.getClosestIntersection(
     pickCanvas.getStartPosition();
     Shape3D s = (Shape3D)result.getNode(PickResult.SHAPE3D);
     System.out.println(s.getClass().getName());
} // end of class Pick

Similar Messages

  • Date Picker problem in Apex 3.1

    Hi,
    I upgraded my apex to 3.1 and found that the date picker icon behaviour become quite strange.
    If I set the label of the date picker Horizontal/Vertical Alignment to Above, the picker icon will show below the text box instead of right side. And the pop-up calendar for Date Picker (DD-MM-YYYY HH24:MI) also not high enought to show the Close and OK button, I have to manually adjust the pop-up calendar height.
    All this problems were not there in 3.01, is these some kind of bug?
    Thanks
    Vincent

    Hello,
    Can you put an example of your particular layout on apex.oracle.com. The solution I had worked in most of the case's I tested , obviously yours is different.
    The next best solution would be to either shim the items with images, or to specifically set the widths of the containing table cells.
    The reason all this is happening is sometimes , depending on the region templates and CSS the regions will collapse down on the content, and the the browsers will do there best to fit the content in the smallest place possible, Unfortunately, in some cases the browsers ignore both nowrap="nowrap" and/or style="white-space:nowrap", why would I want to put nowrap on something and still have it wrap, I don't know it's not me it's the browsers.
    The solution in the patch I'm leaning towards is wrap item into a table. As it will work perfectly everywhere , and greatly annoy people that want tableless layouts, but that won't be available till the patch.
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Solution for a "colour picker" problem.

    Hello, I had the most annoying problem with "Colours" in DreamWeaver 8. I just couldnt seem to get DreamWeaver to select colours from the page I was working in. I could select colours from the colour popup or "swab", but trying to match colours with imported images or other content by putting the "eye dropper" on them in the page itself and selecting just didnt work, it was so frustrating, and time consuming, to say the least. Lots of people here came in with suggestions, but all to no avail. I eventually tracked the problem down, (after about a week) to a little security program on my system called "Snoop Free", which blocks Keyloggers and Screen Readers, and by going into "Snoop Free's" control panel and allowing DreamWeaver access to my screen, the problem was finally "nailed". At the suggestion of "JayJahbrix", I am writing this, as it may help someone else, as I know only too well how frustrating this can be. It might not be "Snoop Free" on your system, but when experiencing problems like this, its always worth checking for solutions outside of DreamWeaver, or whatever software it might be. Check drivers, and defenitely check security software for conflicts. Thanks again to all who stuck with it on my behalf

    I'm glad you got it all sorted.  But the funny thing is I don't use the DW color picker tool much.
    I begin projects with a pre-selected color pallet and a very handy free utility from Iconico called COLOR PIC.  Honestly, can't work without this tool.
    http://www.iconico.com/colorpic/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • Date Picker Problem in BPM VC reports

    Hi All,
    we have created a VC report, which shows the BPM Process information for certain group of users. this is working fine. We are supposed to give some filtering options to the user so as to reduce the amount of records retrieved. We have to filter based upon the process start date (this value is a defalut parameter available when we create a new data source).
    This date is coming in M/D/YY format (ex. 1/1/11). If I use a date picker UI, its date is coming in MM/DD/YYYY format. Due to this the filtering is not working.
    Can some body help me how can I make this work.
    Regards,
    SrinivaS

    Hi All,
    I solved my problem. I added a new Action on submit of type "Assign" and used the below expression for conversion.
    =(DSTR(@STRTDTCUST_From,"M/D/YY")&" - "&DSTR(DADD(@StartDate_To,1,"D"),"M/D/YY"))
    SrinivaS

  • Photoshop Color Picker Problem ... please read!

    Hi
    I just installed Photoshop. When I try to choose a color, the colors are all messed up. I set the color mode to RGB and it still happens. The problem is that white appears light green. In the color picker, I see green fading to red fading to black.
    It is not a monitor problem. All shades of grey (including white) show up in every other program - including the actual Photoshop application. It just happens in the color picker, and any shape or object I draw that is white, grey, or black.
    Here is an image:
    http://img138.imageshack.us/img138/6057/colorpickerrk3.png
    How can I fix this?
    Thanks
    Elliott

    It's not a monitor problem, it's a monitor profile problem. The other mentioned apps are not color managed and do not use the monitor profile. Recalibrate but if you're using an eyeball type calibrator, do not use your existing profile as a starting point. Use a different monitor profile or even sRGB as a starting point. Harware calibration devices and programs do not need to do this as they clear the existing profile automatically.

  • Color picker problems

    I began having this problem in Leopard, (am now on Lion):  My color picker does not function - at all.  I can retrieve the color inspector, but the dropdown menu of the colors is non-functioning, I cannot select or use the magnifying glass feature.  (Its almost like the whole thing is just frozen, or sits there). 
    I've noticed "NSColorPicker.plist" in connection with this, however, on searching my computer for this, it does not show - wonder if I may have deleted it?)  I've also run the Color Utility twice, doesn't seem to help.
    Any ideas??

    That's the intended behavior (clicking on one of the white squares sets your current color to that color).
    To add a color to the array of colors, drag its icon from the top down onto one of the array of squares. (I'm pretty sure it's always been like this).;-)
    Bonus tip: when the RGB or similar sliders are showing, hold down the Option key and click to the left or right of the slider button to increase or decrease the color in increments of one.
    Hope this helps....

  • Date Picker problem in APEX 4.1

    Hi,
    I have developed one application in ApEx 4.0 and imported it in ApEx 4.1. In ApEx 4.1, while clicking the Date picker field (on calendar icon) the application is started giving below error :
    Message: Unable to get value of the property '_curInst': object is null or undefined
    Line: 17
    Char: 1448
    Code: 0
    URI: http://*********/i/javascript/apex_4_1.min.js
    I have gone through the below OTN link,But I do not have such scenario which has been discussed over there.
    Apex 4.1 IR: $.datepicker._curInst' is null or not an object
    Other scenario which I have tried:
    In ApEx 4.1, Created a new application with one page having date picker, it is working fine. If I copy/import this page in my old application(which was imported from ApEx 4.0) then the date picker is showing the above error.
    NOte: We are using IE 8 & 9.
    Regards
    Mohan

    Hi,
    We found the problem. The problem is due the file 'jquery.min.js' file we have uploaded in shared components --> images. Once we deleted then it is working fine.
    Regards
    Mohan

  • Picking Problem

    At the delivery creation on the picking tab Warehouse No. is not getting determined and so as OverallWmStatus is Blank and Gray and remarks are "No WM trnsf ord reqd". OvrllPickStatus is "A" Not yet picked.  Delivery gets saved but transfer order give the error below
    "No items that are to be picked were found"
    Details
    Message no. L3124
    Diagnosis
    This delivery does not contain any open items that require picking.
    This can result from the following conditions:
    •     The delivery item is not assigned to the warehouse number you entered.
    •     The delivery item is not assigned to the plant you entered.
    •     The picking status of the delivery item is marked "not relevant" or "picking complete"
    •     The WM status of the delivery item is "not relevant".
    •     In the delivery item, there is no open quantity to be picked.
    Procedure
    To analyze the exact cause, display the delivery
    and if I Try to PGI without trnsfer order assuming this material is not picking relevant then I get this MSG "Delivery has not yet been put away / picked (completely).
    I am very junior and stuck with this problem for no of days your help will be appreciated a lot.
    Thanks
    Thanks.

    hi syed,
    just do a normal picking for the required delivery quantity. the system telling that a WM transfer order is not required but then, picking is required.
    As well you can confirm this by going to t.code " OVLP "  here you find if the item category is relevant for picking or not.
    Hope it helps you. Pl reward if useful.
    Thanks
    Sadhu Kishore

  • Java3D Install Problem

    I've been using java3d for about 6 months and need to install it on another machine, but can't get it installed correctly. I've installed the sdk 1.4.1_05 correctly and then installed j3d 1.3.1. When I try and run HelloUniverse from either the command prompt or as an applet through IE6 I get this error:
    *** ERROR: Canvas3D constructed with a null GraphicsConfiguration
    *** This will cause a NullPointerException in a subsequent release
    java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration
         at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1100)
         at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:1065)
         at HelloUniverse.init(HelloUniverse.java:97)
         at sun.applet.AppletPanel.run(AppletPanel.java:348)
         at java.lang.Thread.run(Thread.java:536)
    Can anyone help me? Is java3d installed incorrectly or is this something else wrong?

    I don't know about this particular error, but I have had failiures installing Java 3D on older machines with older 3D cards. Both openGL and DirectX.
    Maybe your OS is the problem... You in Linux? Windows? Solaris?

  • Java3D installation problem

    Downloaded java3d-1_2_1_01-win32-directx-sdk.exe
    InstallAnywhere didn't show me the JVM selection screen and it didn't install anything.
    The registry has the JavaSoft SDK 1.3 & runtime 1.3 entries.
    I am running Windows ME with DirectX 8.0
    Any idea ?

    OK, Looks like this is a known problem with Java3D, JDK 1.3.1 and WinME. http://www.j3d.org/installing.html
    Is there a vanilla zip file available ? Maybe I can simply install the jar to the right place bypassing installAnywhere (but here) ?

  • Photoshop CS5 Color picker problem

    Hey!
    Suddeny my Photoshop CS5 Color picker has gone wrong. It wouldn't let me change Foreground or Background colors and goes back to gray all the time.  I have not changed any settings, but last time I used it was yesterday and all worked ok.
    I have restarted my PC sereveral times, that shouldn't be a problem!!
    Thanx
    Eva

    See if this helps:
    http://forums.adobe.com/message/4522262#4522262

  • Photoshop CS6 Brush Preset Picker Problem

    Hello
    I'd like to know if it's possible to tidy up my PSCS 6 Brush Preset Picker?  Please see image.
    My brushes are installed here:  C:/Program Files/Adobe/Adobe Photoshop CS6 (64bit)/Presets/Brushes
    I can't seem to find any other location that would be causing this issue.  It's only happened since I installed CS6.
    Thanks for any help or advice
    Diane

    Thanks for the response.  I realise there are duplicates.  My question is how do I delete the duplicates from the picker?  They're aren't duplicates in the actual folders.  I've also organised the brushes into folders, restarted photoshop, rebooted and the problem is the same.
    Anyone know where the duplicates might be located on my pc? Or how to delete them in the picker?
    Thanks 

  • Colour picker problems

    i'm making a colour picker to pick a colour from a list of buttons, i'm having a few problems getting the layout setout right and creating a second component using the same buttons just to change the background of panel which the second component is located.
    Thanks for your help in advance.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.color.*;
    class Colourpicker extends Panel implements ActionListener{
                   Button               buttonblack,
                                       buttonblue,
                                       buttoncyan,
                                       buttondarkgray,
                                       buttongray,
                                       buttongreen,
                                       buttonlightgray,
                                       buttonmagenta,     
                                       buttonorange,
                                       buttonpink,
                                       buttonred,
                                       buttonwhite,
                                       buttonyellow;
                   Panel               panelmain
                                       paneltitle;
                   Label               labeltitle,
                                       colourselectedlabel;
                   public Color      newcolour;
    public Colourpicker(){
              super();
              paneltitle = new Panel ();
              paneltitle.setLayout (1,1);
              panelmain = new Panel ();
              labeltitle = new Label ("ASSIGNMENT 2, COLOUR PICKER");
              labeltitle.setFont(new Font("Arial",Font.BOLD,14));
              add (labeltitle);
              colourselectedlabel =      new Label("PLEASE SELECT COLOUR ");
                        buttonblack           =      new Button      ("BLACK");
                        buttonblue                =      new Button      ("BLUE");
                        buttoncyan                =      new Button      ("CYAN");
                        buttondarkgray           =      new Button      ("DARK GRAY");
                        buttongray               =      new Button      ("GRAY");
                        buttongreen               =      new Button      ("GREEN");
                        buttonlightgray      =      new Button      ("LIGHT GRAY");
                        buttonmagenta          =      new Button      ("MAGENTA");
                        buttonorange          =      new Button      ("ORANGE");
                        buttonpink               =      new Button     ("PINK");
                        buttonred               =      new Button     ("RED");
                        buttonwhite               =     new Button     ("WHITE");
                        buttonyellow          =     new Button     ("YELLOW");
                        buttonblack.setForeground(Color.white);
                        buttonblack.setBackground(Color.black);
                        buttonblack.setFont(new Font("Arial",Font.BOLD,12));
                        buttonblue.setForeground(Color.white);
                        buttonblue.setBackground(Color.blue);
                        buttonblue.setFont(new Font("Arial",Font.BOLD,12));
                        buttoncyan.setForeground(Color.white);
                        buttoncyan.setBackground(Color.cyan);
                        buttoncyan.setFont(new Font("Arial",Font.BOLD,12));
                        buttondarkgray.setForeground(Color.white);
                        buttondarkgray.setBackground(Color.darkGray);
                        buttondarkgray.setFont(new Font("Arial",Font.BOLD,12));
                        buttongray.setForeground(Color.white);
                        buttongray.setBackground(Color.gray);
                        buttongray.setFont(new Font("Arial",Font.BOLD,12));
                        buttongreen.setForeground(Color.white);
                        buttongreen.setBackground(Color.green);
                        buttongreen.setFont(new Font("Arial",Font.BOLD,12));
                        buttonlightgray.setForeground(Color.white);
                        buttonlightgray.setBackground(Color.lightGray);
                        buttonlightgray.setFont(new Font("Arial",Font.BOLD,12));
                        buttonmagenta.setForeground(Color.white);
                        buttonmagenta.setBackground(Color.magenta);
                        buttonmagenta.setFont(new Font("Arial",Font.BOLD,12));
                        buttonorange.setForeground(Color.white);
                        buttonorange.setBackground(Color.orange);
                        buttonorange.setFont(new Font("Arial",Font.BOLD,12));
                        buttonpink.setForeground(Color.white);
                        buttonpink.setBackground(Color.pink);
                        buttonpink.setFont(new Font("Arial",Font.BOLD,12));
                        buttonred.setForeground(Color.white);
                        buttonred.setBackground(Color.red);
                        buttonred.setFont(new Font("Arial",Font.BOLD,12));
                        buttonwhite.setForeground(Color.black);
                        buttonwhite.setBackground(Color.white);
                        buttonwhite.setFont(new Font("Arial",Font.BOLD,12));
                        buttonyellow.setForeground(Color.white);
                        buttonyellow.setBackground(Color.yellow);
                        buttonyellow.setFont(new Font("Arial",Font.BOLD,12));
                        panelmain.add (buttonblack);
                        panelmain.add (buttonblue);
                        panelmain.add (buttoncyan);
                        panelmain.add (buttondarkgray);
                        panelmain.add (buttongray);
                        panelmain.add (buttongreen);
                        panelmain.add (buttonlightgray);
                        panelmain.add (buttonmagenta);
                        panelmain.add (buttonorange);
                        panelmain.add (buttonpink);
                        panelmain.add (buttonred);
                        panelmain.add (buttonwhite);
                        panelmain.add (buttonyellow);
                        buttonblack.addActionListener          (this);
                        buttonblue.addActionListener          (this);
                        buttoncyan.addActionListener          (this);
                        buttondarkgray.addActionListener     (this);
                        buttongray.addActionListener          (this);
                        buttongreen.addActionListener          (this);
                        buttonlightgray.addActionListener     (this);
                        buttonmagenta.addActionListener          (this);
                        buttonorange.addActionListener          (this);
                        buttonpink.addActionListener          (this);
                        buttonred.addActionListener               (this);
                        buttonwhite.addActionListener          (this);
                        buttonyellow.addActionListener          (this);
    public void actionPerformed (ActionEvent e)
              if (e.getSource() == buttonblack)
                   newcolour = Color.black;
              if (e.getSource() == buttonblue)
                   newcolour = Color.blue;
              if (e.getSource() == buttoncyan)
                   newcolour = Color.cyan;
              if (e.getSource() == buttondarkgray)
                   newcolour = Color.darkGray;
              if (e.getSource() == buttongray)
                   newcolour = Color.gray;
              if (e.getSource() == buttongreen)
                   newcolour = Color.green;
              if (e.getSource() == buttonlightgray)
                   newcolour = Color.lightGray;
              if (e.getSource() == buttonmagenta)
                   newcolour = Color.magenta;
              if (e.getSource() == buttonorange)
                   newcolour = Color.orange;
              if (e.getSource() == buttonpink)
                   newcolour = Color.pink;
              if (e.getSource() == buttonred)
                   newcolour = Color.red;
         if (e.getSource() == buttonwhite)
                   newcolour = Color.white;
              if (e.getSource() == buttonyellow)
                   newcolour = Color.yellow;
    public class Assignment2 extends Applet implements ActionListener{
         Colourpicker      cp1, cp2;
         Button                buttonpick;
         Label                labelcolour;
         Panel               panelbutton;
         public void init(){
              cp1 = new Colourpicker();
              add(cp1);
              panelbutton = new Panel ();
              add (panelbutton);
              buttonpick = new Button ("Click Here");
              buttonpick.addActionListener (this);
              labelcolour = new Label (" ");
              panelbutton.add (buttonpick);
              add (labelcolour);
              cp2 = new Colourpicker();
              add(cp2);
              panelbutton = new Panel ();
              add (panelbutton);
              buttonpick = new Button ("Click Here");
              buttonpick.addActionListener (this);
              labelcolour = new Label (" ");
              panelbutton.add (buttonpick);
              add (labelcolour);
    public void actionPerformed (ActionEvent e)
              labelcolour.setBackground(cp1.newcolour);
              setBackground(cp2.newcolour);

    this my help
    import java.awt.*;
    import java.awt.event.*;
    public class ColorP extends Frame  
         CPanel forP = new CPanel("Foreground");
         CPanel bacP = new CPanel("BackGround");
    public ColorP() 
         setLayout(new BorderLayout());
         Panel pan = new Panel();
         pan.setLayout(new GridLayout(2,0,8,8));
         pan.add(forP);
         pan.add(bacP);
         add("Center",new Panel());     
         add("South",pan);
         setBounds(1,1,550,500);     
         setVisible(true);
    public class CPanel extends Panel implements ActionListener
         Color  color[] = new Color[]{
                            Color.black, Color.blue, Color.cyan, Color.darkGray, Color.gray,
                             Color.green, Color.lightGray, Color.magenta, Color.orange, Color.pink,
                             Color.red, Color.white, Color.yellow};
         String text;
         Label  ch = new Label("Selected Color");
    public CPanel(String text)
         this.text = text;
         setLayout(null);
         setFont(new Font("",1,13));
         setSize(1,54);
         for (int i=0; i < 13; i++)
              Button jb = new Button("");
              jb.addActionListener(this);
              jb.setBackground(color);
              add(jb);
              jb.setBounds(i*15+7,26,15,15);
         ch.setBounds(15*15,25,120,17);
         add(ch);
    public void actionPerformed(ActionEvent ae)
         Component acom = (Component)ae.getSource();
         ch.setBackground(acom.getBackground());
    public void paint(Graphics g)
         g.setColor(Color.black);
         g.drawRect(0,0,getWidth()-1,getHeight()-1);
         g.drawString(text,5,15);
    public static void main (String[] args)
         new ColorP();
    Noah

  • Mysterious Color Picker problem

    Hello,
    I'm a webdesigner and use in my programms the OS X Color Picker. Now there is a big problem.
    I'm writing in the CSS "background-color: #FF0000" and then pick the color with the Color Picker out of the website. The result is "#FF0009". That's really strange and I've no idea how to solve the Problem.
    I hope somebody can help me.
    Thanks

    I've changed the Gamme at 2,2. This was the problem.

  • SharePoint - Person Group Picker - Problem 'JSON' is undefined

    Hi,
    I have the following problem:
    If I click on " Person Group Picker " control in the form by web I get warning:
    This problem exist on IE 11. In Chrome in OK.
    What is wrong?

    Hi  stockDevelopers,
    Is your
    “Person/Group Picker " control  a custom InfoPath form control?
    For my test, I customize a list form using InfoPath and add a  “Person/Group Picker " control. Then I test it in my IE 11, but all work fine.
    Is the form having embed code?
    Also two settings you can have a try:
    1.Open your “Person/Group Picker " control in IE 11, and then press F12, and click Browser Mode, choose IE 10.
    2.If your issue persists,  press ALT, and then click Tools in the Menu bar, click Compatibility View Settings, turn OFF compatibility mode for intranet sites.
    A thread you can have a look:
    http://forum.jquery.com/topic/json-is-undefined-with-jquery-min-2-0-3-on-ie-11
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

Maybe you are looking for

  • Urgent problem: JRE Crashes with Access violation (c0000005)

    I have a problem where the JRE crashes with an Access violation (c0000005) at address (6d4218ce). The JVM is: java version "1.3.1_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01) Java HotSpot(TM) Client VM (build 1.3.1_01, mixed

  • Customer Dunning as per the distribution channel.

    Hello Experts, We wish to do the mass customer dunning as per the distribution channel and avoid printing of the targeted dunning first/earlier 1. What is the process to print the dunning in mass for the whole group of customers of the same type E.G

  • Photoshop Cs5 not opening files

    I'm not actually completely sure if this is an issue with Mavericks because the problem started about 2 1/2 weeks ago, but my Photoshop Cs5 won't open files anymore. As soon as the app launches, I can click on "open..." but as I'm selecting the file,

  • Are permissions updated along with system updates?

    I have heard that permissions are updated along with system updates and that I should use only the latest version of Disk Utility rather than the Disk Utility that is on the original Snow Leopard install disk. Is this true? In my experience, there ar

  • How do you complete this transaction and were do you do it?

    How do you complete this transaction and were do you do it?