关注一下,你那个JPopupMenu应该也是组件,组件一般都可以用setColor();
setSize();
setVisible();
来改变一下(不太懂JPopupMenu)

解决方案 »

  1.   

    选至jdk文档 void setBorderPainted(boolean b) 
              Sets whether the border should be painted. 
    static void setDefaultLightWeightPopupEnabled(boolean aFlag) 
              Sets the default value of the lightWeightPopupEnabled property. 
     void setInvoker(Component invoker) 
              Sets the invoker of this popup menu -- the component in which the popup menu menu is to be displayed. 
     void setLabel(String label) 
              Sets the popup menu's label. 
     void setLightWeightPopupEnabled(boolean aFlag) 
              Sets the value of the lightWeightPopupEnabled property, which by default is true. 
     void setLocation(int x, int y) 
              Sets the location of the upper left corner of the popup menu using x, y coordinates. 
     void setPopupSize(Dimension d) 
              Sets the size of the Popup window using a Dimension object. 
     void setPopupSize(int width, int height) 
              Sets the size of the Popup window to the specified width and height. 
     void setSelected(Component sel) 
              Sets the currently selected component, This will result in a change to the selection model. 
     void setSelectionModel(SingleSelectionModel model) 
              Sets the model object to handle single selections. 
     void setUI(PopupMenuUI ui) 
              Sets the L&F object that renders this component. 
     void setVisible(boolean b) 
              Sets the visibility of the popup menu. 
     void show(Component invoker, int x, int y) 
              Displays the popup menu at the position x,y in the coordinate space of the component invoker. 
     void updateUI() 
              Resets the UI property to a value from the current look and feel. 
      

  2.   

    恩,由于我最初只是想改变JPopupMenu的背景色,边框式样什么的,所以就在JPopupMenu中看,其实JPopupMenu是个组件,完全可以用Component的那些方法修改。
    所以后来就用setBackground(),setBorder()进行了修改。
    对GUI组件还不熟悉,呵呵。