+ 2
Why my codePlayground doesnot show a pop up window on Android is this problem annoying you too!!!!
7 Antworten
+ 6
Maybe, you don't say that it has a alert box... If possible, show me the problem.
+ 5
Jip
+ 5
Nope not any alerts included
+ 4
post your code dude.
+ 3
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class Program
{
    public static void main(String[] args) {
    gui go = new gui();
    go.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    go.setSize(400,200);
    go.setVisible(true);
        
    }
}
public class gui extends JFrame{
   private JPanel mousepanel;
   private JLabel statusbar;
   
public gui(){
   super("the title");
   
   mousepanel = new JPanel();
   mousepanel.setBackground(Color.RED);
   add(mousepanel, BorderLayout.CENTER);
   
   statusbar = new JLabel("default");
   statusbar.setBackground(Color.BLUE);
   add(statusbar, BorderLayout.SOUTH);
   
   thehandler handler = new thehandler();
   mousepanel.addMouseListener(handler);
   mousepanel.addMouseMotionListener(handler);
    
}
private class thehandler implements MouseListener, MouseMotionListener{
   public void mouseClicked(MouseEvent event){
      statusbar.setText(String.format("the mouse is righy now on %d , %d",event.getX(),event.getY()));
   }
   public void mousePressed(MouseEvent event){
      statusbar.setText("you sre pressing the");
   };
   public void mouseReleased(MouseEvent event){
      statusbar.setText("you rrlease the mouse");
   }
   public void mouseEntered(MouseEvent event){
      statusbar.setText("you entered the cursor in the panel");
      mousepanel.setBackground(Color.RED);
   }
   public void mouseExited(MouseEvent event){
      statusbar.setText("You are now out of space");
      mousepanel.setBackground(Color.WHITE);
   }
  //now these are the methods of mouse motion listener
  public void mouseDragged(MouseEvent event){
     statusbar.setText("youare draging the mouse");
  }
  public void mouseMoved(MouseEvent event){
     statusbar.setText("you moves the mouse") ;
  }
}
}
+ 3
see this is the code and problem persists with all of import jfame or flowlayout code
+ 1
problem is this that actually I am using to write code on Android application of solo learn and here it says that "time limit exceeds" while running the code



