Muncul error pada PopUpMenu

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Muncul error pada PopUpMenu

Budi Tri Subiyanto
Halo, rekan2 semua....
Sy dah coba IDE NetBeans & emang persis banget spt IDE Delphi (krn sy msh suka Delphi).
Sy dah mencoba tutorial yg diberikan mas Ifnu (http://ifnubima. googlepages. com/swing- excerpt.pdf)
ttg NetBeans tuk pemula yg memang sangat
cocok sekali bagi sy yg langsung pengin pemgrograman GUI (ga pengin repot ngetik2 di notepad)

Tp ada waktu sy coba yg pake popUpMenu dan masukkan koding-nya spt ini (klik kanan JFrame,
pd Events > Mouse > mousclicked):
private void formMouseClicked(
 java.awt.event.MouseEvent evt) {
 // TODO add your handling code here:
   if(evt.getButton() == MouseEvent.BUTTON3){
     popUpMenu.show(
     (Component)evt.getSource(),
     evt.getX(),evt.getY());
   }
}


muncul pesan error


symbol  : variable MouseEvent
location: class MenuNPopUp
        if(evt.getButton() == MouseEvent.BUTTON3){

symbol  : class Component
location: class MenuNPopUp
            popUpMenu.show((Component)evt.getSource(),evt.getX(),evt.getY()

2 errors
BUILD FAILED (total time: 0 seconds)


Kira2, errornya knp ya?........
Oh iya, sekedar usul, gimana kalo Komunitas NetBeans ato Java membuat forum spt Komunitas programmer Delphi
di http://delphi-id.org. Disana lebih rame lho,........

Sekedar usulan aja.
Terima kasih

Best Regards

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: Muncul error pada PopUpMenu

Tonny Kohar
Hi,

On Wed, 2008-02-27 at 08:02 -0800, Budi Tri Subiyanto wrote:

> symbol : variable MouseEvent
> location: class MenuNPopUp
> if(evt.getButton() == MouseEvent.BUTTON3){
>
> symbol : class Component
> location: class MenuNPopUp
> popUpMenu.show((Component)evt.getSource(),evt.getX(),evt.getY()
>
> 2 errors
> BUILD FAILED (total time: 0 seconds)

Apakah sudah di taruh

import java.awt.event.MouseEvent;
import java.awt.Component;

Cheers
Tonny Kohar
--
Inspiration and Expression
http://blogs.kiyut.com/tonny/

Reply | Threaded
Open this post in threaded view
|

Re: Muncul error pada PopUpMenu

Martinus Ady H (Milis)
Tonny Kohar wrote:

>
>
> Hi,
>
> On Wed, 2008-02-27 at 08:02 -0800, Budi Tri Subiyanto wrote:
>
>  > symbol : variable MouseEvent
>  > location: class MenuNPopUp
>  > if(evt.getButton() == MouseEvent.BUTTON3){
>  >
>  > symbol : class Component
>  > location: class MenuNPopUp
>  > popUpMenu.show((Component)evt.getSource(),evt.getX(),evt.getY()
>  >
>  > 2 errors
>  > BUILD FAILED (total time: 0 seconds)
>
> Apakah sudah di taruh
>
> import java.awt.event.MouseEvent;
> import java.awt.Component;
>
> Cheers
> Tonny Kohar
> --
> Inspiration and Expression
> http://blogs.kiyut.com/tonny/ <http://blogs.kiyut.com/tonny/>
>

Pakai shortcut ajah biar ga nulis import manual :D
Ctrl+Shift+i kalo NB 6, klo NB 5 Alt+Shift+F buat import class2x yg
diperluin ;)
--
Martinus Ady H
http://martinusadyh.web.id/