反射

import java.lang.reflect.*;
import javax.swing.*;
public class showMethods {
    public showMethods() {
        JList list = new JList();
        Method[] methods = list.getClass().getMethods();
        for (int i = 0; i < methods.length; i++) {

            Class cl[] = methods[i].getParameterTypes();
            
            String paramString = "";
            for (int j = 0; j < cl.length; j++) {
                paramString += ("(" + cl[j].toString() + ")");
            }

            System.out.println("==========="+methods[i].getReturnType()+"========" + methods[i].getName()
                    + paramString);
            list.getBorder();
        }
    }

    static public void main(String argv[]) {
        new showMethods();
    }
}

result bellow:





===========void========addListSelectionListener(interface javax.swing.event.ListSelectionListener)
===========void========addSelectionInterval(int)(int)
===========void========clearSelection
===========void========ensureIndexIsVisible(int)
===========class javax.accessibility.AccessibleContext========getAccessibleContext
===========int========getAnchorSelectionIndex
===========class java.awt.Rectangle========getCellBounds(int)(int)
===========interface javax.swing.ListCellRenderer========getCellRenderer
===========boolean========getDragEnabled
===========class javax.swing.JList$DropLocation========getDropLocation
===========class javax.swing.DropMode========getDropMode
===========int========getFirstVisibleIndex
===========int========getFixedCellHeight
===========int========getFixedCellWidth
===========int========getLastVisibleIndex
===========int========getLayoutOrientation
===========int========getLeadSelectionIndex
===========class [Ljavax.swing.event.ListSelectionListener;========getListSelectionListeners
===========int========getMaxSelectionIndex
===========int========getMinSelectionIndex
===========interface javax.swing.ListModel========getModel
===========int========getNextMatch(class java.lang.String)(int)(class javax.swing.text.Position$Bias)
===========class java.awt.Dimension========getPreferredScrollableViewportSize
===========class java.lang.Object========getPrototypeCellValue
===========int========getScrollableBlockIncrement(class java.awt.Rectangle)(int)(int)
===========boolean========getScrollableTracksViewportHeight
===========boolean========getScrollableTracksViewportWidth
===========int========getScrollableUnitIncrement(class java.awt.Rectangle)(int)(int)
===========int========getSelectedIndex
===========class [I========getSelectedIndices
===========class java.lang.Object========getSelectedValue
===========class [Ljava.lang.Object;========getSelectedValues
===========class java.awt.Color========getSelectionBackground
===========class java.awt.Color========getSelectionForeground
===========int========getSelectionMode
===========interface javax.swing.ListSelectionModel========getSelectionModel
===========class java.lang.String========getToolTipText(class java.awt.event.MouseEvent)
===========class javax.swing.plaf.ListUI========getUI
===========class java.lang.String========getUIClassID
===========boolean========getValueIsAdjusting
===========int========getVisibleRowCount
===========class java.awt.Point========indexToLocation(int)
===========boolean========isSelectedIndex(int)
===========boolean========isSelectionEmpty
===========int========locationToIndex(class java.awt.Point)
===========void========removeListSelectionListener(interface javax.swing.event.ListSelectionListener)
===========void========removeSelectionInterval(int)(int)
===========void========setCellRenderer(interface javax.swing.ListCellRenderer)
===========void========setDragEnabled(boolean)
===========void========setDropMode(class javax.swing.DropMode)
===========void========setFixedCellHeight(int)
===========void========setFixedCellWidth(int)
===========void========setLayoutOrientation(int)
===========void========setListData(class [Ljava.lang.Object;)
===========void========setListData(class java.util.Vector)
===========void========setModel(interface javax.swing.ListModel)
===========void========setPrototypeCellValue(class java.lang.Object)
===========void========setSelectedIndex(int)
===========void========setSelectedIndices(class [I)
===========void========setSelectedValue(class java.lang.Object)(boolean)
===========void========setSelectionBackground(class java.awt.Color)
===========void========setSelectionForeground(class java.awt.Color)
===========void========setSelectionInterval(int)(int)
===========void========setSelectionMode(int)
===========void========setSelectionModel(interface javax.swing.ListSelectionModel)
===========void========setUI(class javax.swing.plaf.ListUI)
===========void========setValueIsAdjusting(boolean)
===========void========setVisibleRowCount(int)
===========void========updateUI
===========boolean========contains(int)(int)
===========class java.awt.Point========getLocation(class java.awt.Point)
===========void========print(class java.awt.Graphics)
===========class java.awt.Dimension========getSize(class java.awt.Dimension)
===========boolean========isOpaque
===========void========disable
===========void========enable
===========interface javax.swing.border.Border========getBorder
===========void========firePropertyChange(class java.lang.String)(boolean)(boolean)
===========void========firePropertyChange(class java.lang.String)(int)(int)
===========void========firePropertyChange(class java.lang.String)(char)(char)
===========int========getHeight
===========class java.awt.Insets========getInsets
===========class java.awt.Insets========getInsets(class java.awt.Insets)
===========class [Ljava.util.EventListener;========getListeners(class java.lang.Class)
===========class java.awt.Dimension========getPreferredSize
===========class java.lang.String========getToolTipText
===========class java.awt.Rectangle========getVisibleRect
===========int========getWidth
===========void========repaint(long)(int)(int)(int)(int)
===========void========repaint(class java.awt.Rectangle)
===========void========scrollRectToVisible(class java.awt.Rectangle)
===========void========setAutoscrolls(boolean)
===========void========setFont(class java.awt.Font)
===========void========setOpaque(boolean)
===========void========addAncestorListener(interface javax.swing.event.AncestorListener)
===========void========addNotify
===========void========addVetoableChangeListener(interface java.beans.VetoableChangeListener)
===========void========computeVisibleRect(class java.awt.Rectangle)
===========class javax.swing.JToolTip========createToolTip
===========interface java.awt.event.ActionListener========getActionForKeyStroke(class javax.swing.KeyStroke)
===========class javax.swing.ActionMap========getActionMap
===========float========getAlignmentX
===========float========getAlignmentY
===========class [Ljavax.swing.event.AncestorListener;========getAncestorListeners
===========boolean========getAutoscrolls
===========int========getBaseline(int)(int)
===========class java.awt.Component$BaselineResizeBehavior========getBaselineResizeBehavior
===========class java.awt.Rectangle========getBounds(class java.awt.Rectangle)
===========class java.lang.Object========getClientProperty(class java.lang.Object)
===========class javax.swing.JPopupMenu========getComponentPopupMenu
===========int========getConditionForKeyStroke(class javax.swing.KeyStroke)
===========int========getDebugGraphicsOptions
===========class java.util.Locale========getDefaultLocale
===========class java.awt.FontMetrics========getFontMetrics(class java.awt.Font)
===========class java.awt.Graphics========getGraphics
===========boolean========getInheritsPopupMenu
===========class javax.swing.InputMap========getInputMap(int)
===========class javax.swing.InputMap========getInputMap
===========class javax.swing.InputVerifier========getInputVerifier
===========class java.awt.Dimension========getMaximumSize
===========class java.awt.Dimension========getMinimumSize
===========class java.awt.Component========getNextFocusableComponent
===========class java.awt.Point========getPopupLocation(class java.awt.event.MouseEvent)
===========class [Ljavax.swing.KeyStroke;========getRegisteredKeyStrokes
===========class javax.swing.JRootPane========getRootPane
===========class java.awt.Point========getToolTipLocation(class java.awt.event.MouseEvent)
===========class java.awt.Container========getTopLevelAncestor
===========class javax.swing.TransferHandler========getTransferHandler
===========boolean========getVerifyInputWhenFocusTarget
===========class [Ljava.beans.VetoableChangeListener;========getVetoableChangeListeners
===========int========getX
===========int========getY
===========void========grabFocus
===========boolean========isDoubleBuffered
===========boolean========isLightweightComponent(class java.awt.Component)
===========boolean========isManagingFocus
===========boolean========isOptimizedDrawingEnabled
===========boolean========isPaintingForPrint
===========boolean========isPaintingTile
===========boolean========isRequestFocusEnabled
===========boolean========isValidateRoot
===========void========paint(class java.awt.Graphics)
===========void========paintImmediately(int)(int)(int)(int)
===========void========paintImmediately(class java.awt.Rectangle)
===========void========printAll(class java.awt.Graphics)
===========void========putClientProperty(class java.lang.Object)(class java.lang.Object)
===========void========registerKeyboardAction(interface java.awt.event.ActionListener)(class java.lang.String)(class javax.swing.KeyStroke)(int)
===========void========registerKeyboardAction(interface java.awt.event.ActionListener)(class javax.swing.KeyStroke)(int)
===========void========removeAncestorListener(interface javax.swing.event.AncestorListener)
===========void========removeNotify
===========void========removeVetoableChangeListener(interface java.beans.VetoableChangeListener)
===========boolean========requestDefaultFocus
===========void========requestFocus
===========boolean========requestFocus(boolean)
===========boolean========requestFocusInWindow
===========void========resetKeyboardActions
===========void========reshape(int)(int)(int)(int)
===========void========revalidate
===========void========setActionMap(class javax.swing.ActionMap)
===========void========setAlignmentX(float)
===========void========setAlignmentY(float)
===========void========setBackground(class java.awt.Color)
===========void========setBorder(interface javax.swing.border.Border)
===========void========setComponentPopupMenu(class javax.swing.JPopupMenu)
===========void========setDebugGraphicsOptions(int)
===========void========setDefaultLocale(class java.util.Locale)
===========void========setDoubleBuffered(boolean)
===========void========setEnabled(boolean)
===========void========setFocusTraversalKeys(int)(interface java.util.Set)
===========void========setForeground(class java.awt.Color)
===========void========setInheritsPopupMenu(boolean)
===========void========setInputMap(int)(class javax.swing.InputMap)
===========void========setInputVerifier(class javax.swing.InputVerifier)
===========void========setMaximumSize(class java.awt.Dimension)
===========void========setMinimumSize(class java.awt.Dimension)
===========void========setNextFocusableComponent(class java.awt.Component)
===========void========setPreferredSize(class java.awt.Dimension)
===========void========setRequestFocusEnabled(boolean)
===========void========setToolTipText(class java.lang.String)
===========void========setTransferHandler(class javax.swing.TransferHandler)
===========void========setVerifyInputWhenFocusTarget(boolean)
===========void========setVisible(boolean)
===========void========unregisterKeyboardAction(class javax.swing.KeyStroke)
===========void========update(class java.awt.Graphics)
===========class java.awt.Component========add(class java.awt.Component)
===========class java.awt.Component========add(class java.lang.String)(class java.awt.Component)
===========class java.awt.Component========add(class java.awt.Component)(int)
===========void========add(class java.awt.Component)(class java.lang.Object)
===========void========add(class java.awt.Component)(class java.lang.Object)(int)
===========void========remove(int)
===========void========remove(class java.awt.Component)
===========void========list(class java.io.PrintStream)(int)
===========void========list(class java.io.PrintWriter)(int)
===========void========removeAll
===========class java.awt.Component========getComponent(int)
===========int========getComponentCount
===========class [Ljava.awt.Component;========getComponents
===========class java.awt.FocusTraversalPolicy========getFocusTraversalPolicy
===========void========invalidate
===========boolean========isFocusCycleRoot(class java.awt.Container)
===========boolean========isFocusCycleRoot
===========void========setFocusTraversalPolicy(class java.awt.FocusTraversalPolicy)
===========void========addContainerListener(interface java.awt.event.ContainerListener)
===========void========addPropertyChangeListener(interface java.beans.PropertyChangeListener)
===========void========addPropertyChangeListener(class java.lang.String)(interface java.beans.PropertyChangeListener)
===========void========applyComponentOrientation(class java.awt.ComponentOrientation)
===========boolean========areFocusTraversalKeysSet(int)
===========int========countComponents
===========void========deliverEvent(class java.awt.Event)
===========void========doLayout
===========class java.awt.Component========findComponentAt(int)(int)
===========class java.awt.Component========findComponentAt(class java.awt.Point)
===========class java.awt.Component========getComponentAt(int)(int)
===========class java.awt.Component========getComponentAt(class java.awt.Point)
===========int========getComponentZOrder(class java.awt.Component)
===========class [Ljava.awt.event.ContainerListener;========getContainerListeners
===========interface java.util.Set========getFocusTraversalKeys(int)
===========interface java.awt.LayoutManager========getLayout
===========class java.awt.Point========getMousePosition(boolean)
===========class java.awt.Insets========insets
===========boolean========isAncestorOf(class java.awt.Component)
===========boolean========isFocusTraversalPolicyProvider
===========boolean========isFocusTraversalPolicySet
===========void========layout
===========class java.awt.Component========locate(int)(int)
===========class java.awt.Dimension========minimumSize
===========void========paintComponents(class java.awt.Graphics)
===========class java.awt.Dimension========preferredSize
===========void========printComponents(class java.awt.Graphics)
===========void========removeContainerListener(interface java.awt.event.ContainerListener)
===========void========setComponentZOrder(class java.awt.Component)(int)
===========void========setFocusCycleRoot(boolean)
===========void========setFocusTraversalPolicyProvider(boolean)
===========void========setLayout(interface java.awt.LayoutManager)
===========void========transferFocusBackward
===========void========transferFocusDownCycle
===========void========validate
===========void========add(class java.awt.PopupMenu)
===========class java.lang.String========toString
===========class java.lang.String========getName
===========boolean========contains(class java.awt.Point)
===========class java.awt.Dimension========size
===========class java.awt.Point========getLocation
===========class java.awt.Container========getParent
===========void========remove(class java.awt.MenuComponent)
===========void========setName(class java.lang.String)
===========void========list
===========void========list(class java.io.PrintStream)
===========void========list(class java.io.PrintWriter)
===========class java.awt.Dimension========getSize
===========void========setSize(int)(int)
===========void========setSize(class java.awt.Dimension)
===========void========resize(int)(int)
===========void========resize(class java.awt.Dimension)
===========void========enable(boolean)
===========class java.awt.Point========location
===========boolean========action(class java.awt.Event)(class java.lang.Object)
===========void========firePropertyChange(class java.lang.String)(byte)(byte)
===========void========firePropertyChange(class java.lang.String)(short)(short)
===========void========firePropertyChange(class java.lang.String)(long)(long)
===========void========firePropertyChange(class java.lang.String)(float)(float)
===========void========firePropertyChange(class java.lang.String)(double)(double)
===========class java.awt.ComponentOrientation========getComponentOrientation
===========class java.awt.Font========getFont
===========boolean========hasFocus
===========void========repaint
===========void========repaint(long)
===========void========repaint(int)(int)(int)(int)
===========class java.awt.Color========getBackground
===========class java.awt.Rectangle========getBounds
===========class java.awt.Container========getFocusCycleRootAncestor
===========class java.awt.Color========getForeground
===========interface java.awt.peer.ComponentPeer========getPeer
===========class [Ljava.beans.PropertyChangeListener;========getPropertyChangeListeners
===========class [Ljava.beans.PropertyChangeListener;========getPropertyChangeListeners(class java.lang.String)
===========class java.lang.Object========getTreeLock
===========boolean========isDisplayable
===========boolean========isEnabled
===========boolean========isMaximumSizeSet
===========boolean========isMinimumSizeSet
===========boolean========isPreferredSizeSet
===========boolean========isShowing
===========boolean========isVisible
===========void========nextFocus
===========void========setBounds(int)(int)(int)(int)
===========void========setBounds(class java.awt.Rectangle)
===========void========setLocale(class java.util.Locale)
===========void========setLocation(int)(int)
===========void========setLocation(class java.awt.Point)
===========void========dispatchEvent(class java.awt.AWTEvent)
===========class java.awt.GraphicsConfiguration========getGraphicsConfiguration
===========class java.awt.Point========getMousePosition
===========boolean========handleEvent(class java.awt.Event)
===========boolean========isFocusOwner
===========boolean========isFocusable
===========boolean========isLightweight
===========boolean========isValid
===========boolean========postEvent(class java.awt.Event)
===========void========transferFocus
===========void========addComponentListener(interface java.awt.event.ComponentListener)
===========void========addFocusListener(interface java.awt.event.FocusListener)
===========void========addHierarchyBoundsListener(interface java.awt.event.HierarchyBoundsListener)
===========void========addHierarchyListener(interface java.awt.event.HierarchyListener)
===========void========addInputMethodListener(interface java.awt.event.InputMethodListener)
===========void========addKeyListener(interface java.awt.event.KeyListener)
===========void========addMouseListener(interface java.awt.event.MouseListener)
===========void========addMouseMotionListener(interface java.awt.event.MouseMotionListener)
===========void========addMouseWheelListener(interface java.awt.event.MouseWheelListener)
===========class java.awt.Rectangle========bounds
===========int========checkImage(class java.awt.Image)(interface java.awt.image.ImageObserver)
===========int========checkImage(class java.awt.Image)(int)(int)(interface java.awt.image.ImageObserver)
===========class java.awt.Image========createImage(interface java.awt.image.ImageProducer)
===========class java.awt.Image========createImage(int)(int)
===========class java.awt.image.VolatileImage========createVolatileImage(int)(int)
===========class java.awt.image.VolatileImage========createVolatileImage(int)(int)(class java.awt.ImageCapabilities)
===========void========enableInputMethods(boolean)
===========class java.awt.image.ColorModel========getColorModel
===========class [Ljava.awt.event.ComponentListener;========getComponentListeners
===========class java.awt.Cursor========getCursor
===========class java.awt.dnd.DropTarget========getDropTarget
===========class [Ljava.awt.event.FocusListener;========getFocusListeners
===========boolean========getFocusTraversalKeysEnabled
===========class [Ljava.awt.event.HierarchyBoundsListener;========getHierarchyBoundsListeners
===========class [Ljava.awt.event.HierarchyListener;========getHierarchyListeners
===========boolean========getIgnoreRepaint
===========class java.awt.im.InputContext========getInputContext
===========class [Ljava.awt.event.InputMethodListener;========getInputMethodListeners
===========interface java.awt.im.InputMethodRequests========getInputMethodRequests
===========class [Ljava.awt.event.KeyListener;========getKeyListeners
===========class java.util.Locale========getLocale
===========class java.awt.Point========getLocationOnScreen
===========class [Ljava.awt.event.MouseListener;========getMouseListeners
===========class [Ljava.awt.event.MouseMotionListener;========getMouseMotionListeners
===========class [Ljava.awt.event.MouseWheelListener;========getMouseWheelListeners
===========class java.awt.Toolkit========getToolkit
===========boolean========gotFocus(class java.awt.Event)(class java.lang.Object)
===========void========hide
===========boolean========imageUpdate(class java.awt.Image)(int)(int)(int)(int)(int)
===========boolean========inside(int)(int)
===========boolean========isBackgroundSet
===========boolean========isCursorSet
===========boolean========isFocusTraversable
===========boolean========isFontSet
===========boolean========isForegroundSet
===========boolean========keyDown(class java.awt.Event)(int)
===========boolean========keyUp(class java.awt.Event)(int)
===========boolean========lostFocus(class java.awt.Event)(class java.lang.Object)
===========boolean========mouseDown(class java.awt.Event)(int)(int)
===========boolean========mouseDrag(class java.awt.Event)(int)(int)
===========boolean========mouseEnter(class java.awt.Event)(int)(int)
===========boolean========mouseExit(class java.awt.Event)(int)(int)
===========boolean========mouseMove(class java.awt.Event)(int)(int)
===========boolean========mouseUp(class java.awt.Event)(int)(int)
===========void========move(int)(int)
===========void========paintAll(class java.awt.Graphics)
===========boolean========prepareImage(class java.awt.Image)(interface java.awt.image.ImageObserver)
===========boolean========prepareImage(class java.awt.Image)(int)(int)(interface java.awt.image.ImageObserver)
===========void========removeComponentListener(interface java.awt.event.ComponentListener)
===========void========removeFocusListener(interface java.awt.event.FocusListener)
===========void========removeHierarchyBoundsListener(interface java.awt.event.HierarchyBoundsListener)
===========void========removeHierarchyListener(interface java.awt.event.HierarchyListener)
===========void========removeInputMethodListener(interface java.awt.event.InputMethodListener)
===========void========removeKeyListener(interface java.awt.event.KeyListener)
===========void========removeMouseListener(interface java.awt.event.MouseListener)
===========void========removeMouseMotionListener(interface java.awt.event.MouseMotionListener)
===========void========removeMouseWheelListener(interface java.awt.event.MouseWheelListener)
===========void========removePropertyChangeListener(interface java.beans.PropertyChangeListener)
===========void========removePropertyChangeListener(class java.lang.String)(interface java.beans.PropertyChangeListener)
===========void========setComponentOrientation(class java.awt.ComponentOrientation)
===========void========setCursor(class java.awt.Cursor)
===========void========setDropTarget(class java.awt.dnd.DropTarget)
===========void========setFocusTraversalKeysEnabled(boolean)
===========void========setFocusable(boolean)
===========void========setIgnoreRepaint(boolean)
===========void========show
===========void========show(boolean)
===========void========transferFocusUpCycle
===========void========wait(long)
===========void========wait(long)(int)
===========void========wait
===========int========hashCode
===========class java.lang.Class========getClass
===========boolean========equals(class java.lang.Object)
===========void========notify
===========void========notifyAll




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值