MouseMotionListener question

Hi,
I have discovered an interesting problem with the MouseMotionListener class.
I have a window, say, a frame and in that I have a MouseMotionListener added to it. Now, in the MouseMoving method, I just print out the X and Y on the frame. Simple.
However, when I say, press the mouse one button and then move my mouse, suddenly, the MouseMoving method isn't being called. When I let loff with the button and resume moving the mouse, it starts to print out the locations again.
Does anyone know how get around this?
Thanks.

Your mouseDragged method will be notified

Similar Messages

  • (MouseMotionListener) mouseDragged question.

    I'm implementing an mp3 player. It has multiple jframes displaying things like the playlist, button window, etc. (not unlike WinAMP). I decided that normal windows title bars are huge and ugly, so I decided to set the playlist window to setUndecorated(true);. There's no inherent way to drag this around the screen. So, I decided to stick a JLabel at top and then to move the window around whenever that JLabel calls its MouseMotionListener's mouseDragged() method. Seems fairly simple.
    However, it would appear that when I move the window around in order to respond to the mouse dragging, the moving the window itself calls the mouseDragged method, causing the window to jump around the screen as I drag it. I can't seem to keep track of it to "filter" these events out in order to stop this. What should I do?

    Check out this posting for an example of dragging a window:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=599181

  • Problem w/ MouseMotionListener on JTable cell

    Hey everyone,
    I am using a MouseMotionListener on a JTable, and in most cases it works fine. The case where it does NOT work as I would expect is when you are editing a cell. In that case, events do not register when the mouse is moving over the cell being edited. I'm assuming that for some reason the cell editor maybe is receiving the events... but I'm not sure that is the case, and if it is, not sure how to deal with it. Here's a very basic example:
    ***************** begin code example ************************************
    public class Main extends JFrame {
    /** Creates a new instance of Main */
    public Main() {
    this.setLayout(new BorderLayout());
    JPanel panel = new JPanel();
    JTable theTable = new JTable(1,1);
    theTable.addMouseMotionListener(new MouseMotionListener() {
                   public void mouseDragged(MouseEvent e) {
                        // TODO Auto-generated method stub
                   public void mouseMoved(MouseEvent e) {
                        System.out.println("Mouse Moved");
    panel.add(theTable);
    this.add(panel,BorderLayout.NORTH);
    this.setSize(100,100);
    setVisible(true);
    * @param args the command line arguments
    public static void main(String[] args) {
    Main main = new Main();
    ***************** end code example **************************************
    Now, what I want to do is be able to have a listener not only on the table, but also on the cells (even when they are being edited). It is worth noting that the listener still functions around the borders of the cell... just not when mousing over the cell itself. What is going on with this? What is the best way for me to achieve my desired results?
    Thanks in advance,
    Jared

    Thanks for the tip on code formatting tags camickr. I'm (obviously) new to the forums.
    I am using "balloon tool tips" (can be seen here: https://balloontip.dev.java.net) to display information about the columns. The way I am currently doing it is that I have a MouseMotionListener on the entire JTable, and I attach the balloon tool tip to the header directly above the center of the column that the mouse is over. The way I am able to always know where to attach the balloon tool tip at the top is by using the events from the MouseMotionListener, as well as the X coordinate provided by the event. It works wonderfully... until one of the cells is being edited. At that point it works wonderfully on every part of the JTable except that one cell.
    Does that answer your question?
    Thanks again,
    Jared

  • Do I use DnD or MouseMotionListener ?

    I am wondering about the pros and cons of using dnd api vs. MouseListener/MouseMotionListener.
    I am experimenting with drag-and-drop using a simple app that allows components to be rearranged by dragging.
    Here is a description of desired test program behavior:
    For instance, if 5 rectangular panel components [A,B,C,D,E] are in a vertical row, and B is dragged onto D, then it is meant that B should be moved to before D, so the components will jump to new order [A,C,B,D,E]. (This is a simple test app for my learning, so I am ignoring that nothing can be moved to after E.)
    There is a visual indicator during the drag operation. In the above example where B, the dragsource, is dragged to D:
    - When drag begins, dragsource is on B, so indicator is a little notch arrow between A and B.
    - When drag moves onto C, notch arrow jumps to between B and C.
    - When drag moves onto D, notch arrow jumps to between C and D.
    - When drag released on D, components jump to rearrage themselves as user would expect from indicator arrow position.
    If drag goes outside the 5 components, the indicator arrow will stay where it was (i.e. it only updates at enter not exit)
    If mouse released outside the 5 components (or outside app window), the drag/move operation is aborted: the indicator goes away and no components move.
    The dragged-into component listener calls to parent panel to update the indicator arrow.
    The dropped-onto component listener calls to parent panel to reorder children.
    This description is pretty sound and simple in theory, but I am new to MouseMotionListener and java.awt.dnd. Which is better for this purpose?
    DND:
    - Can use listener to tell me about the enter, drop, and dragEnded events.
    - Since my app is not truly performing datatransfer, I would need to fool it with adding new action or dataflavor type (so not to mix up with other types of dragsources and targets).
    - I don't know how to discover the dragged component from a DropTargetDragEvent
    MouseMotion:
    - Would probably simplify everything and shorten my code.
    - Can use listener to tell me about the drag, enter, and release events.
    - Don't know how I would detect/handle the cases where mouse moved/released outside the application or outside the listening components.
    /Mel
    I will post the so-far-source if anyone is actually interested to see it.

    Hi,
    I know it kinda very late as its been a while since you posted your question, but i realized that is exavtly what i am trying to achieve in my project. Move labels within a panel among themselves. I was wondering if you might still have to code and if so, can you please send it to me?? my email id is [email protected]
    or if ou dont, and you do read this email, I would really appreciate it if you can let me know how?
    thanks very mucg,
    Sri.

  • OO question

    Hi . Sorry, newbie question, but still, I'm stuck:
    I have a program X.
    In public class X, in main, I have something like
    myFrame frame=new myFrame();....
    In class myFrame extends JFrame, in the constructor "public myFrame()", I have
    //Add panel to frame:
    myPanel panel=new myPanel();
    add(panel);
    //Add a window events listener
    addWindowListener(new WindowEventsListener());
    In class myPanel I implemented the isDirty property and an accessor,
    getDirtyState. In WindowEventsListener, upon closing, I'd like to check the isDirty property of myPanel.
    My problem is that in WindowEventsListener I cannot say
    public void windowClosing(WindowEvent e)
    JOptionPane pane = new JOptionPane();
    Toolkit.getDefaultToolkit().beep();
    if (getDirtyState()==true)
    if (pane.showConfirmDialog(e.getComponent(),"Save drawing before quitting
    ?", "Sketch", JOptionPane.YES_NO_OPTION)==0)
    //The user chose YES
    pane.showMessageDialog(e.getComponent(), "Save here !", "Program X",
    JOptionPane.OK_OPTION);
    System.exit(0);
    else
    System.exit(0);
    because getDirtyState refers to myPanel, and I don't see myPanel from there.
    Which is the proper OO way of passing this value all the way to my
    WindowEventsListener, please ? The isDirty belongs in myPanel, not in
    myFrame, and, either way, how would I pass that value to class
    WindowEventsListener which extends WindowAdapter ?
    Thank you, Alex.

    First, thank you very much for your answer...
    Sorry, I have tried to use your suggestion, but I think that I'm missing something - I would have to use a constructor of class WindowEventsListener which would take a parameter of that type. Somehow, it doesn't work - I'll try again tomorrow.
    While waiting for an answer, I "solved" the problem with the following (gauche, I'm sure) code (this is the complete code):
    package raducu;
    import javax.swing.*;
    public class Blackboard {
         public static void main(String[] args)
              SketchFrame frame=new SketchFrame();
              frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
              frame.setVisible(true);
    }//End class Blackboard
    package raducu;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import javax.swing.JFrame;
    class SketchFrame extends JFrame
         public SketchPanel panel;
         public SketchFrame()
              Toolkit kit=Toolkit.getDefaultToolkit();          
              Dimension screenSize=kit.getScreenSize();
              int screenWidth=screenSize.width;
              int screenHeight=screenSize.height;                    
              setSize(screenWidth/2, screenHeight/2);
              setLocation(screenWidth/4,screenHeight/4);
              //setExtendedState(MAXIMIZED_BOTH);
              setIconImage(kit.getImage("red-ball.gif"));          
              setTitle("Blackboard");
              //Add panel to frame:
              this.panel=new SketchPanel();
              add(this.panel);          
              //Add a window events listener
              addWindowListener(new WindowEventsListener());
    }//End class SketchFrame
    package raducu;
    import java.awt.*;
    import java.awt.geom.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JPanel;
    public class SketchPanel extends JPanel
         private Point2D previousEnd;
         private ArrayList<Line2D> lines;     
         private static final double RADIUS=2.5;
         private boolean isDirty;
         private boolean isClicked;
         //Constructor
         public SketchPanel()
              this.previousEnd=new Point2D.Double(0,0);
              this.lines= new ArrayList<Line2D>();
              this.isDirty=false;
              setForeground(Color.YELLOW);
              MouseMotionListener mouseMotionListener = new MouseMotionHandler();          
              this.addMouseMotionListener(mouseMotionListener);
              MouseListener mouseListener=new MouseClickHandler();
              this.addMouseListener(mouseListener);
              //Define actions
              Action yellowAction=new ColorAction("Yellow",new ImageIcon("yellow-ball.gif"), Color.YELLOW);
              Action blueAction=new ColorAction("Blue",new ImageIcon("blue-ball.gif"), Color.blue);
              Action redAction=new ColorAction("Red",new ImageIcon("red-ball.gif"), Color.red);
              //Add buttons for these actions:
              add(new JButton(yellowAction));
              add(new JButton(blueAction));
              add(new JButton(redAction));
              //Associate the Y, B and R keys with names
              InputMap imap=getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
              imap.put(KeyStroke.getKeyStroke("ctrl Y"), "panel.yellow");
              imap.put(KeyStroke.getKeyStroke("ctrl R"), "panel.red");
              imap.put(KeyStroke.getKeyStroke("ctrl B"), "panel.blue");
              //Associate the names with actions
              ActionMap amap=getActionMap();
              amap.put("panel.yellow", yellowAction);
              amap.put("panel.red", redAction);
              amap.put("panel.blue", blueAction);
         //Adds to "lines" array
         private void addLine(int dx, int dy)
              //compute new end point
              Point2D newEnd=new Point2D.Double(dx, dy);
              //add line segment
              Line2D line=new Line2D.Double(this.previousEnd, newEnd);          
              this.lines.add(line);          
              //remember new end point
              this.previousEnd=newEnd;
              this.isDirty=true;
         //resets the Point tracking, so that when the mouse is dragged, no line is added and the end point is updated
         private void resetLine(int dx, int dy)
              //remember new end point
              this.previousEnd=new Point2D.Double(dx, dy);          
         private boolean getClicked()
              return this.isClicked;
         private void setClicked(boolean isClicked)
              this.isClicked=isClicked;
         public boolean getDirtyState()
              return this.isDirty;
         //overrides the paintComponent method of object Component.
         public void paintComponent(Graphics g)     
              super.paintComponent(g);
              setBackground(Color.BLACK);          
              Graphics2D g2=(Graphics2D) g;
              //draw all lines:          
              for (Line2D l : this.lines)
                   g2.draw(l);
         //inner class MouseMotionHandler
         class MouseMotionHandler extends MouseMotionAdapter
              public void mouseDragged(MouseEvent event)
                   if (SketchPanel.this.isClicked==true)
                        SketchPanel.this.addLine(event.getX(), event.getY());                    
                        repaint();
         }//end inner class MouseMotionHandler
         //inner class MouseClickHandler
         class MouseClickHandler extends MouseAdapter
              public void mousePressed(MouseEvent event)
                   if ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK)!=0)
                        SketchPanel.this.isClicked=true;
                        resetLine(event.getX(), event.getY());
              public void mouseReleased(MouseEvent event)
                   SketchPanel.this.isClicked=false;               
         }//end inner class MouseClickHandler
         //inner class for ActionListener. AbstractAction is a class implementing the Action interface...
         class ColorAction extends AbstractAction
              //Constructs a "color" action object
              public ColorAction(String name, Icon icon, Color c)
                   putValue(Action.NAME, name);
                   putValue(Action.SMALL_ICON, icon);
                   putValue(Action.SHORT_DESCRIPTION, "Sets panel to " + name.toLowerCase());
                   putValue("color", c);
              public void actionPerformed(ActionEvent event)
                   Color c=(Color) getValue("color");
                   setForeground(c);               
         }//end inner class ColorAction
    }//End class SketchPanel
    package raducu;
    import java.awt.Toolkit;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JOptionPane;
    class WindowEventsListener extends WindowAdapter
         public void windowStateChanged(WindowEvent e)
              System.out.println(e.toString());
         public void windowClosing(WindowEvent e)
              JOptionPane pane = new JOptionPane();          
              SketchFrame x;
              x=(SketchFrame) e.getSource();
              if (x.panel.getDirtyState()==true)          
                   Toolkit.getDefaultToolkit().beep();
                   if (pane.showConfirmDialog(e.getComponent(),"Save drawing before quitting ?", "Blackboard", JOptionPane.YES_NO_OPTION)==0)
                        //The user chose YES                    
                        pane.showMessageDialog(e.getComponent(), "Save here !", "Blackboard", JOptionPane.OK_OPTION);
                        System.exit(0);
                   else
                        System.exit(0);
              else
                   System.exit(0);
    }As you can see, in windowClosing I take a reference to the source, which happens to be my Frame object, which contains a public "panel" object. It's not clean, I know... I'll try your suggestion.
    Thank you very much....

  • DnD and MouseMotionListener

    Hi,
    I am trying to move one panel(1) inside another one -
    panel(2) with DnD. I think that everything works good, but only one problem. Can't change positioning (x,y) of panel(1) inside the panel(2). I am trying to use MouseMotionListener-mouseDragged(), but no help.
    May be I am doing something wrong. How to coonect action of MouseMotionListener with DnD.
    Here is my code.
    class DNDPanel extends JPanel implements
    DropTargetListener, MouseMotionListener {
    int x;
    int y;
    public DNDPanel() {
    super();
    setBackground(Color.black);
    setLayout(null);
    add(new DraggablePanel()).setLocation(x, y);
    addMouseMotionListener(this);
    DropTarget dt = new DropTarget(this, this);
    public void mouseDragged(MouseEvent e) {
    x = e.getX();
    y = e.getY(); // I think that problem hides somewhere here.
    public void drop(DropTargetDropEvent dtde) {
    if(isValidDragDrop(dtde.getDropAction(), dtde.getCurrentDataFlavors())) {
    dtde.acceptDrop(dtde.getDropAction());
    try {
    Transferable xfer = dtde.getTransferable();
    Object obj = xfer.getTransferData(MyFlavors.draggablePanelFlavor);
    if(obj instanceof JComponent) {
    add(new DraggablePanel()).setLocation(x, y);
    // or here???
    revalidate();
    catch(Exception exc) {
    System.err.println(exc);
    exc.printStackTrace();
    dtde.dropComplete(false);
    else {dtde.rejectDrop();}
    class DraggablePanel extends JPanel implements DragSourceListener,
    DragGestureListener,
    Transferable {
    public DraggablePanel() {
    super();
    setBackground(Color.red);
    setPreferredSize(new Dimension(100,100));
    setBounds(0,0,100,100);
    JButton button = new JButton("Beep");
    button.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    Toolkit.getDefaultToolkit().beep();
    add(button);
    DragSource ds = DragSource.getDefaultDragSource();
    DragGestureRecognizer dgr = ds.createDefaultDragGestureRecognizer(
    this, DnDConstants.ACTION_COPY_OR_MOVE, this);
    Thank you. I really need HELP!
    DM.

    hi,
    I dont completely understand your question, but if you are trying to get the coordinates of the component with respect to the parent panel, try methods from SwingUtilities, like converPoint,.....
    Am not sure if that completely answers your question, but I had a similiar problem, ad then used this. Hope this helps!
    Sri.

  • Background picture to famous "ImageTest" applet - Is it supid Question?

    I would like to see what Pholser will say about this. :)
    Is this a dumest question or what ?
    Thanks in advance
    basisdba
    ------------------ Repeated----------------------------------------
    Hi to all,
    I am not sure if you could help on this one or not, but
    will be happy to see any responding on this :))
    This is the example that I have worked on:
    http://java.sun.com/applets/other/ImageTest/index.html
    I am trying to add a sold background to this, is this possible?
    Thanks in advance
    Regards,

    Hi Sam and all of you,
    Sorry for the delay I am very bussy daily as SAP adminstrator,
    if you know what I mean :)
    You both are right but with some minor corrections.
    You guys are all great after all...
    I attached ImageTest.java demo sample with this modification to the
    background only...I am trying to add extra code into it to allow
    NOT only BLUE/RED swap color but also some more colors, how can I do
    that? How can I add black, green, yellow and so on...(stupid nah :) )
    Why in the hell "Java Tech.." make the color defining so hard? :)
    Or it would be nice to have a 16 color table to choose from...
    Thanks again to all of you and I also rewarded your points based
    on the most recent "white house" logic! :)))))
    Regards,
    ------------------------------- Start of the code
    /*Modified only ImageTest.java Demo
    import java.lang.Math.*; // for Spray
    import java.awt.*; // note to self - imports CURSOR class
    import javax.swing.*; // for ui
    import java.awt.image.*; // for images
    import java.applet.*; // for sounds
    import java.awt.event.*; // for events
    import java.net.*; // URL
    import java.net.URL;
    import java.util.Vector;
    import java.awt.geom.*; // for Line2D
    import java.util.*; // used for the Vector in the flood fill method
    import java.util.StringTokenizer;
    public class ImageTest extends Applet {
    //Init
    public void init()
    // Image bg0 = applet.getImage(applet.getDocumentBase(),"images/bg0.gif");
    setLayout(new BorderLayout());
    add("Center", new ImagePanel(this));
    add("North", new ImageHelp());
    setVisible(true);
    public String getAppletInfo()
    return "A simple image manipulation tool.";
    class ImageHelp extends Panel {
    public ImageHelp() {
    setLayout(new GridLayout(6, 1)); //Grid 5 Row and 1 column
    //m
    // add(new Button("Move"));
    //m
    add(new Label("test",
    Label.CENTER));
    add(new Label("Image Move: < > ^ v, or with [L]eft/[R]ight/p/[D]own",
    Label.CENTER));
    add(new Label("Image Resize: +/-",
    Label.CENTER));
    add(new Label("Color Filter: T key",
    Label.CENTER));
    add(new Label("Change Alpha: (Shift)+/-",
    Label.CENTER));
    add(new Label("Rotate Image: (Shift)<> or (Shift)[L]eft/[R]ight",
    Label.CENTER));
    System.out.println("");
    class ImagePanel extends Panel
    Applet applet;
    public ImagePanel(Applet app) {
    applet = app;
    setLayout(new BorderLayout());
    Panel grid = new Panel();
    grid.setLayout(new GridLayout(1, 1)); //first(row), second (column)
    add("Center", grid);
         Image bg0 = applet.getImage(applet.getDocumentBase(),"images/bg0.gif");
         Image fg0 = applet.getImage(applet.getDocumentBase(),"images/ff001.gif");
         grid.add(new ImageCanvas(applet, fg0, bg0, 1.0));
         setBounds(0, 0, 20, 20);
    class ImageCanvas
    extends Canvas
    implements ImageObserver, KeyListener, MouseListener,
    MouseMotionListener, FocusListener {
    double hmult = 0;
    int xadd = 0;
    int yadd = 0;
    int xprev = 0;
    int yprev = 0;
    int imgw = -1;
    int imgh = -1;
    int xoff = 0;
    int yoff = 0;
    int scalew = -1;
    int scaleh = -1;
    boolean focus = false;
    boolean usefilter = false;
    static final int numalphas = 9;
    int alpha = numalphas - 1;
    static final int numrotations = 8;
    int rotation = 0;
    ImageFilter colorfilter;
    ImageFilter alphafilters[] = new ImageFilter[numalphas];
    RotateFilter rotfilters[] = new RotateFilter[numrotations];
    Image origimage;
    Image curimage, backimage;
    Applet applet;
         public BufferedImage currentImage, oldImage, tempImage, storedImage;
    Image bg0, bg1, bg2, bgImage;
         public URL URL_STRING;
    private int picNo = 0;
    public void init()
    try {
         bg0 = new ImageIcon(new URL(URL_STRING +"images/bg0.gif")).getImage();
         bg1 = new ImageIcon(new URL(URL_STRING +"images/bg1.gif")).getImage();
         catch (Exception exc)
         {//imgLoad = "Image failed to load";
    public ImageCanvas(Applet app, Image img,Image bg0,double mult) {
    applet = app;
    origimage = img;
    backimage = bg0;
    hmult = mult;
    pickImage();
    setBounds(0, 0, 100, 100);
    addMouseListener(this);
    addMouseMotionListener(this);
    addKeyListener(this);
    addFocusListener(this);
    //1.1 event handling
    public void focusGained(FocusEvent e) {
    focus = true;
    repaint();
    public void focusLost(FocusEvent e) {
    focus = false;
    repaint();
    public void keyPressed(KeyEvent e) {
    public void keyTyped(KeyEvent e) {
    char key = e.getKeyChar();
    switch(key)
    case 't':
    case 'T':
    usefilter = !usefilter;
    pickImage();
    repaint();
    e.consume();
    break;
    case '^':
    case '6':
    case 'u':
    case 'U':
    yadd -= 5;
    repaint();
    e.consume();
    break;
    case 'v':
    case 'V':
    case 'd':
    case 'D':
    yadd += 5;
    repaint();
    e.consume();
    break;
    case '>':
    case 'R':
    rotation--;
    if (rotation < 0) {
    rotation = numrotations - 1;
    pickImage();
    scalew = scaleh = -1;
    repaint();
    e.consume();
    break;
    case '.':
    case 'r':
    xadd += 5;
    repaint();
    e.consume();
    break;
    case '<':
    case 'L':
    rotation++;
    if (rotation >= numrotations) {
    rotation = 0;
    pickImage();
    scalew = scaleh = -1;
    repaint();
    e.consume();
    break;
    case ',':
    case 'l':
    xadd -= 5;
    repaint();
    e.consume();
    break;
    case '+':
    if (++alpha > numalphas - 1) {
    alpha = numalphas - 1;
    pickImage();
    repaint();
    e.consume();
    break;
    case '=':
    hmult *= 1.2;
    scalew = scaleh = -1;
    repaint();
    e.consume();
    break;
    case '-':
    hmult /= 1.2;
    scalew = scaleh = -1;
    repaint();
    e.consume();
    break;
    case '_':
    if (--alpha < 0) {
    alpha = 0;
    pickImage();
    repaint();
    e.consume();
    break;
    public void keyReleased(KeyEvent e) {
    public void mouseClicked(MouseEvent e) {
    public void mousePressed(MouseEvent e) {
    xprev = e.getX();
    yprev = e.getY();
    e.consume();
    public void mouseReleased(MouseEvent e) {
    e.consume();
    public void mouseEntered(MouseEvent e) {
    requestFocus();
    e.consume();
    public void mouseExited(MouseEvent e) {
    public void mouseDragged(MouseEvent e) {
    int x = e.getX();
    int y = e.getY();
    xadd += x - xprev;
    yadd += y - yprev;
    xprev = x;
    yprev = y;
    repaint();
    e.consume();
    public void mouseMoved(MouseEvent e) {
         //method selects a random image for the child to draw on or colour in
         public void backGroundImage(){
    public void paint(Graphics g) {
    g.drawImage(backimage, 0, 0, this);
    Rectangle r = getBounds();
    int hlines = r.height / 10;
    int vlines = r.width / 10;
    if (imgw < 0) {
    imgw = curimage.getWidth(this);
    imgh = curimage.getHeight(this);
    if (imgw < 0 || imgh < 0) {
    return;
    if (scalew < 0) {
    if (rotation == 0) {
    scalew = imgw;
    scaleh = imgh;
    } else {
    Rectangle rect = new Rectangle(0, 0, imgw, imgh);
    rotfilters[rotation].transformBBox(rect);
    xoff = rect.x;
    yoff = rect.y;
    scalew = rect.width;
    scaleh = rect.height;
    scalew = (int) (scalew * hmult);
    scaleh = (int) (scaleh * hmult);
    xoff = (imgw - scalew) / 2;
    yoff = (imgh - scaleh) / 2;
    if (imgw != scalew || imgh != scaleh) {
    g.drawImage(curimage, xadd + xoff, yadd + yoff,
    scalew, scaleh, this);
    } else {
    g.drawImage(curimage, xadd + xoff, yadd + yoff, this);
    static final long updateRate = 100;
    public synchronized boolean imageUpdate(Image img, Image bg0,int infoflags,
    int x, int y, int w, int h) {
    if (img != curimage) {
    return false;
    boolean ret = true;
    boolean dopaint = false;
    long updatetime = 0;
    if ((infoflags & WIDTH) != 0) {
    imgw = w;
    dopaint = true;
    if ((infoflags & HEIGHT) != 0) {
    imgh = h;
    dopaint = true;
    if ((infoflags & (FRAMEBITS | ALLBITS)) != 0) {
    dopaint = true;
    ret = false;
    } else if ((infoflags & SOMEBITS) != 0) {
    dopaint = true;
    updatetime = updateRate;
    if ((infoflags & ERROR) != 0) {
    ret = false;
    if (dopaint) {
    repaint(updatetime);
    return ret;
    public synchronized Image pickImage() {
    ImageProducer src = origimage.getSource();
    if (alpha != numalphas - 1) {
    ImageFilter imgf = alphafilters[alpha];
    if (imgf == null) {
    int alphaval = (alpha * 255) / (numalphas - 1);
    imgf = new AlphaFilter(alphaval);
    alphafilters[alpha] = imgf;
    src = new FilteredImageSource(src, imgf);
    if (rotation != 0) {
    RotateFilter imgf = rotfilters[rotation];
    if (imgf == null) {
    double angle = (2 * Math.PI * rotation) / numrotations;
    imgf = new RotateFilter(angle);
    rotfilters[rotation] = imgf;
    src = new FilteredImageSource(src, imgf);
    if (usefilter) {
    if (colorfilter == null) {
    colorfilter = new RedBlueSwapFilter();
    src = new FilteredImageSource(src, colorfilter);
    Image choice;
    if (src == origimage.getSource()) {
    choice = origimage;
    } else {
    choice = applet.createImage(src);
    if (curimage != choice) {
    if (curimage != null && curimage != origimage) {
    curimage.flush();
    curimage = choice;
    return choice;
    class RedBlueSwapFilter extends RGBImageFilter {
    public RedBlueSwapFilter() {
    canFilterIndexColorModel = true;
    public void setColorModel(ColorModel model) {
    if (model instanceof DirectColorModel) {
    DirectColorModel dcm = (DirectColorModel) model;
    int rm = dcm.getRedMask();
    int gm = dcm.getGreenMask();
    int bm = dcm.getBlueMask();
    int am = dcm.getAlphaMask();
    int bits = dcm.getPixelSize();
    dcm = new DirectColorModel(bits, bm, gm, rm, am);
    substituteColorModel(model, dcm);
    consumer.setColorModel(dcm);
    } else {
    super.setColorModel(model);
    public int filterRGB(int x, int y, int rgb)
    return ((rgb & 0xFF000000)) | ((rgb & 0xff00ff00)|((rgb & 0xff0000) >> 16)| ((rgb & 0xff) << 16)); //
    //return ((rgb & 0xff00ff00)|((rgb & 0xff0000) >> 16)| ((rgb & 0xff) << 16)); //
    class AlphaFilter extends RGBImageFilter {
    ColorModel origmodel;
    ColorModel newmodel;
    int alphaval;
    public AlphaFilter(int alpha) {
    alphaval = alpha;
    canFilterIndexColorModel = true;
    public int filterRGB(int x, int y, int rgb) {
    int alpha = (rgb >> 24) & 0xff;
    alpha = alpha * alphaval / 255;
    return ((rgb & 0x00ffffff) | (alpha << 24));
    //------------------------------- End of the code

  • 3 questions regarding alignment, rectangle drawing, and a error I get

    3 Questions:
    ========================================
    1. Why does the DOS window in Code Warrior show this error in it, but it doesn't affect the operation of the applet?
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at PianoApplet.paint(PianoApplet.java)
    at sun.awt.RepaintArea.paint(RepaintArea.java:293)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:191)
    at java.awt.Component.dispatchEventImpl(Component.java:2658)
    at java.awt.Container.dispatchEventImpl(Container.java:1208)
    at java.awt.Component.dispatchEvent(Component.java:2492)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:126)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:93)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at PianoApplet.paint(PianoApplet.java)
    at java.awt.Container.update(Container.java:976)
    at sun.awt.RepaintArea.update(RepaintArea.java:332)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:195)
    at java.awt.Component.dispatchEventImpl(Component.java:2658)
    at java.awt.Container.dispatchEventImpl(Container.java:1208)
    at java.awt.Component.dispatchEvent(Component.java:2492)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:126)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:93)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
    ===========================================
    Second Question
    How do I align this so that it is is on the right on the applet, cause it overlaps my keyboard when I just place it.
    private TextArea intro = new TextArea("Welcome to the PianoApplet! \nHere you will be able to play a full sized octave of keys. \nClick a key to play the key. \nYou can also drag your mouse across the keyboard \nand play multiple notes at once.", 5, 40);
    ===========================================
    Third Question
    When I do this:
    if(state.equals("duh")){
    g.setColor(Color.green);
    g.fillRect(150,50,40,90);
    g.drawImage(iduh,100, 200, this);
    It colors everything green, not just the duh key, it also colors the duh sharp, reh, and half the reh sharp. Why is that?
    =========================================
    Please answer any of my questions.
    Thanks.
    ==========
    My Code
    ==========
    import java.awt.*;
    import java.applet.Applet;
    import javax.swing.*;
    import java.awt.event.*;
    import java.applet.AudioClip;
    public class PianoApplet extends Applet implements MouseListener, MouseMotionListener {
    private Point mouse = new Point();
    //private TextField output=new TextField(30);
    //private TextArea intro = new TextArea("Welcome to the PianoApplet! \nHere you will be able to play a full sized octave of keys. \nClick a key to play the key. \nYou can also drag your mouse across the keyboard \nand play multiple notes at once.", 5, 40);
    private String state = null;
    //The images
    private Image iduh, ire, ime, ifa, isol, ila, isi, iduh2, iduhsharp, iemptynotes, ifasharp, ilasharp, iresharp, isolsharp;
    //The sounds
    AudioClip duh;
    AudioClip re;
    AudioClip me;
    AudioClip fa;
    AudioClip sol;
    AudioClip la;
    AudioClip si;
    AudioClip duh2;
    AudioClip b0;
    AudioClip b1;
    AudioClip b2;
    AudioClip b3;
    AudioClip b4;
    public void init(){
    //load images of notes here
    iduh = getImage(getCodeBase(), "duh.jpg");
    ire = getImage(getCodeBase(), "re.jpg");
    ime = getImage(getCodeBase(), "me.jpg");
    ifa = getImage(getCodeBase(), "fa.jpg");
    isol = getImage(getCodeBase(), "sol.jpg");
    ila = getImage(getCodeBase(), "la.jpg");
    isi = getImage(getCodeBase(), "si.jpg");
    iduh2 = getImage(getCodeBase(), "duh2.jpg");
    iduhsharp = getImage(getCodeBase(), "duhsharp.jpg");
    iemptynotes = getImage(getCodeBase(), "emptynotes.jpg");
    ifasharp = getImage(getCodeBase(), "fasharp.jpg");
    ilasharp = getImage(getCodeBase(), "lasharp.jpg");
    iresharp = getImage(getCodeBase(), "resharp.jpg");
    isolsharp = getImage(getCodeBase(), "solsharp.jpg");
    //load sounds of piano here
    duh = getAudioClip(getCodeBase(),"duh.au");
    re = getAudioClip(getCodeBase(),"re.au");
    me = getAudioClip(getCodeBase(),"me.au");
    fa = getAudioClip(getCodeBase(),"fa.au");
    sol = getAudioClip(getCodeBase(),"sol.au");
    la = getAudioClip(getCodeBase(),"la.au");
    si = getAudioClip(getCodeBase(),"si.au");
    duh2 = getAudioClip(getCodeBase(),"duh2.au");
    b0 = getAudioClip(getCodeBase(),"b0.au");
    b1 = getAudioClip(getCodeBase(),"b1.au");
    b2 = getAudioClip(getCodeBase(),"b2.au");
    b3 = getAudioClip(getCodeBase(),"b3.au");
    b4 = getAudioClip(getCodeBase(),"b4.au");
    addMouseListener(this);
    addMouseMotionListener(this);
    //add(output);
    setSize(750,300);
    //add(intro);
    public void paint(Graphics g) {
    g.setColor(Color.black);
    g.drawRect(150,50,40,90); g.fillRect(165,50,12,60);
    g.drawRect(170,50,40,90);
    g.fillRect(185,50,12,60);
    g.drawRect(190,50,40,90);
    g.drawRect(210,50,40,90);
    g.fillRect(225,50,12,60);
    g.drawRect(230,50,40,90);
    g.fillRect(245,50,12,60);
    g.drawRect(250,50,40,90);
    g.fillRect(265,50,12,60);
    g.drawRect(270,50,40,90);
    g.drawImage(iemptynotes,100, 200, this);
    if(state.equals("duh")){
    g.setColor(Color.green);
    g.fillRect(150,50,40,90);
    g.drawImage(iduh,100, 200, this);
    if(state.equals("re")){
    g.drawImage(ire,100, 200, this);
    if(state.equals("me")){
    g.drawImage(ime,100, 200, this);
    if(state.equals("fa")){
    g.drawImage(ifa,100, 200, this);
    if(state.equals("sol")){
    g.drawImage(isol,100, 200, this);
    if(state.equals("la")){
    g.drawImage(ila,100, 200, this);
    if(state.equals("si")){
    g.drawImage(isi,100, 200, this);
    if(state.equals("duh2")){
    g.drawImage(iduh2,100, 200, this);
    if(state.equals("b0")){
    g.drawImage(iduhsharp,100, 200, this);
    if(state.equals("b2")){
    g.drawImage(ifasharp,100, 200, this);
    if(state.equals("b4")){
    g.drawImage(ilasharp,100, 200, this);
    if(state.equals("b1")){
    g.drawImage(iresharp,100, 200, this);
    if(state.equals("b3")){
    g.drawImage(isolsharp,100, 200, this);
    public void mouseClicked(MouseEvent e){
    mouse = e.getPoint();
    //output.setText("x: " + mouse.x + " y: " + mouse.y);
    repaint();
    if (((50<mouse.y && mouse.y<110) && (150<mouse.x && mouse.x<165)) || ((110<mouse.y && mouse.y<140) && (150<mouse.x && mouse.x<170)))
    //setBackground(Color.green);
    duh.play();
    state = "duh";
    repaint();
    System.out.println("Duh");
    else if (((50<mouse.y && mouse.y<110) && (165<mouse.x && mouse.x<175)))
    b0.play();
    state = "b0";
    repaint();
    System.out.println("b0");
    else if (((50<mouse.y && mouse.y<110) && (175<mouse.x && mouse.x<185)) || ((110<mouse.y && mouse.y<140) && (170<mouse.x && mouse.x<190)))
    re.play();
    state = "re";
    repaint();
    System.out.println("reh");
    else if (((50<mouse.y && mouse.y<110) && (185<mouse.x && mouse.x<195)))
    b1.play();
    state = "b1";
    repaint();
    System.out.println("b1");
    else if (((50<mouse.y && mouse.y<110) && (195<mouse.x && mouse.x<210)) || ((110<mouse.y && mouse.y<140) && (190<mouse.x && mouse.x<210)))
    me.play();
    state = "me";
    repaint();
    System.out.println("me");
    else if (((50<mouse.y && mouse.y<110) && (210<mouse.x && mouse.x<225)) || ((110<mouse.y && mouse.y<140) && (210<mouse.x && mouse.x<230)))
    fa.play();
    state = "fa";
    repaint();
    System.out.println("fa");
    else if (((50<mouse.y && mouse.y<110) && (225<mouse.x && mouse.x<235)))
    b2.play();
    state = "b2";
    repaint();
    System.out.println("b2");
    else if (((50<mouse.y && mouse.y<110) && (235<mouse.x && mouse.x<245)) || ((110<mouse.y && mouse.y<140) && (235<mouse.x && mouse.x<250)))
    sol.play();
    state = "sol";
    repaint();
    System.out.println("sol");
    else if (((50<mouse.y && mouse.y<110) && (245<mouse.x && mouse.x<255)))
    b3.play();
    state = "b3";
    repaint();
    System.out.println("b3");
    else if (((50<mouse.y && mouse.y<110) && (255<mouse.x && mouse.x<265)) || ((110<mouse.y && mouse.y<140) && (255<mouse.x && mouse.x<270)))
    la.play();
    state = "la";
    repaint();
    System.out.println("la");
    else if (((50<mouse.y && mouse.y<110) && (265<mouse.x && mouse.x<275)))
    b4.play();
    state = "b4";
    repaint();
    System.out.println("b4");
    else if (((50<mouse.y && mouse.y<110) && (275<mouse.x && mouse.x<290)) || ((110<mouse.y && mouse.y<140) && (270<mouse.x && mouse.x<290)))
    si.play();
    state = "si";
    repaint();
    System.out.println("si");
    else if (((50<mouse.y && mouse.y<140) && (290<mouse.x && mouse.x<310)))
    duh2.play();
    state = "duh2";
    repaint();
    System.out.println("duh");
    public void mouseDragged(MouseEvent e) {
    //output.setText("x: " + mouse.x + " y: " + mouse.y);
    mouse = e.getPoint();
    repaint();
    if (((50<mouse.y && mouse.y<110) && (150<mouse.x && mouse.x<165)) || ((110<mouse.y && mouse.y<140) && (150<mouse.x && mouse.x<170)))
    //setBackground(Color.green);
    duh.play();
    state = "duh";
    repaint();
    System.out.println("Duh");
    else if (((50<mouse.y && mouse.y<110) && (165<mouse.x && mouse.x<175)))
    b0.play();
    state = "b0";
    repaint();
    System.out.println("b0");
    else if (((50<mouse.y && mouse.y<110) && (175<mouse.x && mouse.x<185)) || ((110<mouse.y && mouse.y<140) && (170<mouse.x && mouse.x<190)))
    re.play();
    state = "re";
    repaint();
    System.out.println("reh");
    else if (((50<mouse.y && mouse.y<110) && (185<mouse.x && mouse.x<195)))
    b1.play();
    state = "b1";
    repaint();
    System.out.println("b1");
    else if (((50<mouse.y && mouse.y<110) && (195<mouse.x && mouse.x<210)) || ((110<mouse.y && mouse.y<140) && (190<mouse.x && mouse.x<210)))
    me.play();
    state = "me";
    repaint();
    System.out.println("me");
    else if (((50<mouse.y && mouse.y<110) && (210<mouse.x && mouse.x<225)) || ((110<mouse.y && mouse.y<140) && (210<mouse.x && mouse.x<230)))
    fa.play();
    state = "fa";
    repaint();
    System.out.println("fa");
    else if (((50<mouse.y && mouse.y<110) && (225<mouse.x && mouse.x<235)))
    b2.play();
    state = "b2";
    repaint();
    System.out.println("b2");
    else if (((50<mouse.y && mouse.y<110) && (235<mouse.x && mouse.x<245)) || ((110<mouse.y && mouse.y<140) && (235<mouse.x && mouse.x<250)))
    sol.play();
    state = "sol";
    repaint();
    System.out.println("sol");
    else if (((50<mouse.y && mouse.y<110) && (245<mouse.x && mouse.x<255)))
    b3.play();
    state = "b3";
    repaint();
    System.out.println("b3");
    else if (((50<mouse.y && mouse.y<110) && (255<mouse.x && mouse.x<265)) || ((110<mouse.y && mouse.y<140) && (255<mouse.x && mouse.x<270)))
    la.play();
    state = "la";
    repaint();
    System.out.println("la");
    else if (((50<mouse.y && mouse.y<110) && (265<mouse.x && mouse.x<275)))
    b4.play();
    state = "b4";
    repaint();
    System.out.println("b4");
    else if (((50<mouse.y && mouse.y<110) && (275<mouse.x && mouse.x<290)) || ((110<mouse.y && mouse.y<140) && (270<mouse.x && mouse.x<290)))
    si.play();
    state = "si";
    repaint();
    System.out.println("si");
    else if (((50<mouse.y && mouse.y<140) && (290<mouse.x && mouse.x<310)))
    duh2.play();
    state = "duh2";
    repaint();
    System.out.println("duh");
    public void mouseEntered(MouseEvent e){ }
    public void mouseExited(MouseEvent e){ }
    public void mousePressed(MouseEvent e){ }
    public void mouseReleased(MouseEvent e){ }
    public void mouseMoved(MouseEvent e){ }
    }

    question 2:
    BFI answer:
    put everything you have in a panel
    put your text area beside it.
    question 1:
    something about painting a .java file just seems wrong.
    question 3:
    because you told it to.

  • Question about drawLine()

    hi all , i just start to learn java, i need help, this almost kill me.....
    condition:
    a click in the drawing panel indicates the starting point of the line. As the
    mouse is moved a line appears between the starting point and the current position of the
    mouse. When the mouse is clicked again, the line is frozen in its current position.
    my code :
    first i create a Line class:
    class Line extends Figure {
    public Line( int x1, int y1, int x2, int y2 ){
    super(x1, y1, x2-x1, y2-y1 ) ;
    public void paint(Graphics g) {
    super.paint(g);
    Dimension size = getSize() ;
    g.setColor(Color.blue);
    g.drawLine ( 0, 0, size.width-1, size.height-1) ;
    then
    class DrawingPanel extends JPanel
    implements MouseListener,MouseMotionListener, Constants {
    static String s ="Circle";
    int x1,y1,x2,y2;
    DrawingPanel(){
    super();
    addMouseListener( this );
    addMouseMotionListener(this);
    public void setMode(String s){
    this.s = s;
    public void mouseClicked(MouseEvent e) {
    Point at = e.getPoint();
    if (s.equals("Line")){
    x1=at.x;
    y1=at.y;
    public void mouseMoved(MouseEvent e) {
    if( s.equals("Line")){
    x2=e.getX();
    y2=e.getY();
    this.add (new Line(x1,y1,x2,y2));
    well , this is part of my code , it do work, but not exactly what i want..

    try:
    gc.setLineStyle(SWT.LINE_DASH);
    gc.setLineWidth(2);
    gc.drawLine(....)
    "kyo" <[email protected]> wrote in message
    news:cojd6v$nr$[email protected]..
    > hi all:
    >
    > sorry to trouble you,recently i met a question about drawLine:
    >
    > while i use a control(Line extends CLable)'s GC(gc) to draw it on OS
    > windows, firstly i call gc.setLineWidth(SWT.LINE_DASH),then
    > gc.setLineWidth(2).
    > finally gc.drawLine.
    >
    > and the result is the line's width is set, but the line's style is not
    > set?
    >
    > i want to know how to handle it.
    >
    > looking forward your answer! thank you.
    >

  • Questions on Print Quote report

    Hi,
    I'm fairly new to Oracle Quoting and trying to get familiar with it. I have a few questions and would appreciate if anyone answers them
    1) We have a requirement to customize the Print Quote report. I searched these forums and found that this report can be defined either as a XML Publisher report or an Oracle Reports report depending on a profile option. Can you please let me know what the name of the profile option is?
    2) When I select the 'Print Quote' option from the Actions drop down in the quoting page and click Submit I get the report printed and see the following URL in my browser.
    http://<host>:<port>/dev60cgi/rwcgi60?PROJ03_APPS+report=/proj3/app/appltop/aso/11.5.0/reports/US/ASOPQTEL.rdf+DESTYPE=CACHE+P_TCK_ID=23731428+P_EXECUTABLE=N+P_SHOW_CHARGES=N+P_SHOW_CATG_TOT=N+P_SHOW_PRICE_ADJ=Y+P_SESSION_ID=c-RAuP8LOvdnv30grRzKqUQs:S+P_SHOW_HDR_ATTACH=N+P_SHOW_LINE_ATTACH=N+P_SHOW_HDR_SALESUPP=N+P_SHOW_LN_SALESUPP=N+TOLERANCE=0+DESFORMAT=RTF+DESNAME=Quote.rtf
    Does it mean that the profile in our case is set to call the rdf since it has reference to ASOPQTEL.rdf in the above url?
    3) When you click on submit button do we have something like this in the jsp code: On click call ASOPQTEL.rdf. Is the report called using a concurrent program? I want to know how the report is getting invoked?
    4) If we want to customize the jsp pages can you please let me know the steps involved in making the customizations and testing them.
    Thanks and Appreciate your patience
    -PC

    1) We have a requirement to customize the Print Quote report. I searched these forums and found that this report can be defined either as a XML Publisher report or an Oracle Reports report depending on a profile option. Can you please let me know what the name of the profile option is?
    I think I posted it in one of the threads2) When I select the 'Print Quote' option from the Actions drop down in the quoting page and click Submit I get the report printed and see the following URL in my browser.
    http://<host>:<port>/dev60cgi/rwcgi60?PROJ03_APPS+report=/proj3/app/appltop/aso/11.5.0/reports/US/ASOPQTEL.rdf+DESTYPE=CACHE+P_TCK_ID=23731428+P_EXECUTABLE=N+P_SHOW_CHARGES=N+P_SHOW_CATG_TOT=N+P_SHOW_PRICE_ADJ=Y+P_SESSION_ID=c-RAuP8LOvdnv30grRzKqUQs:S+P_SHOW_HDR_ATTACH=N+P_SHOW_LINE_ATTACH=N+P_SHOW_HDR_SALESUPP=N+P_SHOW_LN_SALESUPP=N+TOLERANCE=0+DESFORMAT=RTF+DESNAME=Quote.rtf
    Does it mean that the profile in our case is set to call the rdf since it has reference to ASOPQTEL.rdf in the above url?
    Yes, your understanding is correct.3) When you click on submit button do we have something like this in the jsp code: On click call ASOPQTEL.rdf. Is the report called using a concurrent program? I want to know how the report is getting invoked?
    No, there is no conc program getting called, you can directly call a report in a browser window, Oracle reports server will execute the report and send the HTTP response to the browser.4) If we want to customize the jsp pages can you please let me know the steps involved in making the customizations and testing them.
    This is detailed in many threads.Thanks
    Tapash

  • Satellite P300D-10v - Question about warranty

    HI EVERYBODY
    I have these overheating problems with my laptop Satellite P300D-10v.
    I did everything I could do to fix it without any success..
    I get the latest update of the bios from Toshiba. I cleaned my lap with compressed air first and then disassembled it all and cleaned it better.(it was really clean insight though...)
    BUT unfortunately the problem still exists...
    So i made a research on the internet and I found out that most of Toshiba owners have the same exactly problem with their laptop.
    Well i guess this is a Toshiba bug for many years now.
    Its a really nice lap, cool sound (the best in laptop ever) BUT......
    So I wanted to make a question. As i am still under warranty, can i return this laptop and get my money back or change it with a different one????
    If any body knows PLS let me know.
    chears
    Thanks in advance

    Hi
    I have already found you other threads.
    Regarding the warranty question;
    If there is something wrong with the hardware then the ASP in your country should be able to help you.
    The warranty should cover every reparation or replacement.
    But I read that you have disasembled the laptop at your own hand... hmmm if you have disasembled the notebook then your warrany is not valid anymore :(
    I think this should be clear for you that you can lose the warrany if you disasemble the laptop!
    By the way: you have to speak with the notebook dealer where you have purchased this notebook if you want to return the notebook
    The Toshiba ASP can repair and fix the notebook but you will not get money from ASP.
    Greets

  • Question regarding NULL and forms

    Hi all, i have a survey that im working on that will be sent via email.
    I'm having an issue though. if i have a multiple choice question, and the user only selects one of the choices, all the unselected choices return as NULL. is there a way i can filter out anytihng that says "NULL" so it only shows the selected options?
    thanks.
    here is the page that retrieves all the data. thanks
    <body>
    <p>1) Is this your first visit to xxxxxxx? <b><%=request.getParameter("stepone") %></b>
    </p>
    <p> </p>
    <p>2) How did You Learn About xxxxxxx?</p>
    <p><b><%=request.getParameter("steptwoOne") %></b>
      <br>
        <b><%=request.getParameter("steptwoTwo") %></b>
      <br>
        <b><%=request.getParameter("steptwoThree") %></b>
      <br>
        <b><%=request.getParameter("steptwoFour") %></b>
      <br>
        <b><%=request.getParameter("steptwoOther") %></b>
    </p>
    <p> </p>
    <p>3) What was your main reason for visiting xxxxx?</p>
    <p><b><%=request.getParameter("stepthreeOne") %></b>
        <br>
          <b><%=request.getParameter("stepthreeTwo") %></b>
        <br>
          <b><%=request.getParameter("stepthreeThree") %></b>
        <br>
          <b><%=request.getParameter("stepthreeFour") %></b>
        <br>
          <b><%=request.getParameter("stepthreeOther") %></b>
    </p>
    <p>4) did you find the information you were looking for on this site?</p>
    <p><b><%=request.getParameter("stepfour") %>
    <br>
    <b><%=request.getParameter("stepfourOther") %></b>
    </b></p>
    <p>5) Do you plan on using this website in the future?</p>
    <p><b><%=request.getParameter("stepfive") %></b></p>
    <p>6) What is your gender</p>
    <p><b><%=request.getParameter("stepsix") %></b></p>
    <p>7) What is your age group</p>
    <p><b><%=request.getParameter("stepseven") %></b></p>
    8) Would you like to take a moment and tell us how we can improve your experience on xxxxxxxxxx?
    <p><b><%=request.getParameter("stepeightFeedback") %></b></p>

    i was messing around and came up with this. it doesnt remove the null, but if it is null it adds ABC beside it. so i think i might be getting close. i just need to figure out how to replace the null.
    code]
    <b><%=request.getParameter("steptwoFour") %></b>
         <% if (request.getParameter("steptwoFour") == null ) {
         %>
         <% out.print("abc"); %>
         <% }
         %>

  • Anyone know how to remove Overdrive books from my iphone that have been transferred from my computer? They do not show up on itunes. I see a lot of answers to this question but they all are based on being able to see the books in iTunes.

    How do I remove Overdrive books from the library that were downloaded onto my computer then transferred to my iphone? The problem is that they do not show up in iTunes.
    I see this question asked a lot when I google, but they always give answers that assumes you can find the books in iTunes either under the books tab, or the audio books tab or in the music. They do not show up anywhere for me. They do not remove from the app like the ones I downloaded directly onto my iphone.the related archived article does not answer it either.  I even asked a guy working at an apple store and he could not help either.   Anybody...?
    Thanks!

    there is an app called daisydisk on mac app store which will help you see exactly where the memory is focused and consumed try using that app and see which folders are using more memory

  • Basic question

    Hello, i have a basic question. if i have defined 2 fields in a cube or a dso:
    Name Quantity
    and from the external flat file i get some characters for my quantity field. would my load fail?  for standard dso and for write optimized?
    NOTE: quantity field is a keyfigure defined as numeric.
    and the load coming in has "VIKPATEL" for Quantity field and not numbers.
    thanks

    Hi Vik,
    Yes, the load will fail.
    May be you coud first load this data into BW (into PSA) and set both fields as characters fields. Then you can create DSO, do transformation from this PSA to the DSO, and put your logic as to what do you want to do with those Quantity that is not number (e.g. convert to 0, or 'Not assgined', etc).
    You can use transfer rule, or a clean up ABAP code in the start routine.
    Hope this helps.

  • Mid 2010 15" i5 Battery Calibration Questions

    Hi, I have a mid 2010 15" MacBook Pro 2.4GHz i5.
    Question 1: I didn't calibrate my battery when I first got my MacBook Pro (it didn't say in the manual that I had to). I've had it for about a month and am doing a calibration today, is that okay? I hope I haven't damaged my battery? The calibration is only to help the battery meter provide an accurate reading of how much life it has remaining, right?
    Question 2: After reading Apple's calibration guide, I decided to set the MacBook Pro to never go to sleep (in Energy Saver System Preference) and leave it on overnight so it would run out of power and go to sleep, then I'd leave it in that state for at least 5 hours before charging it. When I woke up, the light on the front wasn't illuminated. It usually pulsates when in Sleep. Expectedly, it wouldn't wake when pressing buttons on the keyboard. So, what's happened? Is this Safe Sleep? I didn't see any "Your Mac is on reserve battery and will shut down" dialogues or anything similar, as I was asleep! I've left it in this state while I'm at work and will charge it this afternoon. Was my described method okay for calibration or should I have done something different?
    Question 3: Does it matter how quickly you drain your battery when doing a calibration? i.e is it okay to drain it quickly (by running HD video, Photo Booth with effects etc) or slowly (by leaving it idle or running light apps)?
    Thanks.
    Message was edited by: Fresh J

    Fresh J:
    A1. You're fine calibrating the battery now. You might have gotten more accurate readings during the first month if you'd done it sooner, but no harm has been done.
    A2. Your machine has NOT shut down; it has done exactly what it was supposed to do. When the power became critically low, it first wrote the contents of RAM to the hard drive, then went to sleep. When the battery was completely drained some time later, the MBP went into hibernation and the slepp light stopped pulsing and turned off. In that state the machine was using no power at all, but the contents of your RAM were still saved. Once the AC adapter was connected, a press of the power button would cause those contents to be reloaded, and the machine would pick up again exactly where you left off. It is not necessary to wait for the battery to be fully charged before using the machine on AC power, but do leave the AC adapter connected for at least two hours after the battery is fully charged. Nothing that you say you've done was wrong, and nothing that you say has happened was wrong.
    A3. No, it does not matter.

Maybe you are looking for

  • SQL Injections and XSS - Escaping Special Characters

    Hi, hope someone can help in regards to security and SQL Injections and XSS. We are using APEX 4.0.2 on Oracle 11.2.0.2. 1. It seems the special characters we have entered into normal 'Text Items' 'Text Areas' etc are not being escaped (ie <,>,&, ').

  • Mail preview issue

    Is there a way to change the way mail is previewed? It drives me nuts that the inbox is to the left and it keeps an email open behind it

  • Airport Express "ethernet unplugged"

    My airport express was working fine. Now has blinking yellow light. Airport utility says "ethernet unplugged". I verified that the AE is plugged into a working ethernet cable from my router by unplugging the AE and plugging a laptop into the same cab

  • I have 1 firewire port, what do i do?

    i have an external connected via usb 2.0...i have one firewire port and if i am capturing footage, i need that firewire port, so the usb port is my only option. am i right or wwrong. pelase help. what are osme solutions?

  • Error when installing new license key

    Hi, I am trying to install the license key for the Netweaver 7.01 Basis Test system with saplicense -install ifile=NSP.txt and am getting the following error message: SAPLICENSE (Release 701) ERROR ***      ERROR: Can not set DbSl trace function