Fandom

Scratchpad

Klassen und Methoden

219,168pages on
this wiki
Add New Page
Discuss this page0 Share

Java-Objects:

- import :

   -   java.awt.*
   -   java.awt.event.*
   -   javax.swing.*
   -   javax.swing.border.*
   -   javax.swing.event*      /* nur ChangeListener */

- AWT :

   -   ButtonGroup
       -   public void         add(AbstractButton b)   /* z.B. AbstactButton = JRadioButton */
       -   public ButtonModel  getSelection()          /* z.B. ButtonModel   = JRadioButton */
       -   public void         setSelected(ButtonModel m, boolean b)

- Border :

   -   EmptyBorder
       -   EmptyBorder(int top, int left, int bottom, int right)
   -   LineBorder
       -   LineBorder(Color color)
       -   LineBorder(Color color, int thickness)
       -   LineBorder(Color color, int thickness, boolean roundedCorners)        
   -   TitledBorder
       -   TitledBorder(String title)

- Color :

   -   Color(int rgb)
   -   Color(int r, int g, int b)
   -   Color(int r, int g, int b, int a) /* a = Transparenz */
   rgb :
       -   Color.BLACK
       -   Color.BLUE
       -   Color.CYAN
       -   Color.DARK_GRAY
       -   Color.GRAY
       -   Color.GREEN
       -   Color.LIGHT_GRAY
       -   Color.MAGENTA
       -   Color.ORANGE
       -   Color.PINK
       -   Color.RED
       -   Color.WHITE
       -   Color.YELLOW

- Cursor :

   -   Cursor(int type)
   type :
       -   Cursor.CROSSHAIR_CURSOR /* Kreuz    */
       -   Cursor.HAND_CURSOR      /* Hand     */
       -   Cursor.TEXT_CURSOR      /* ?        */
       -   Cursor.WAIT_CURSOR      /* Uhr ?    */

- Dimension :

   -   Dimension(int width, int height)

- Double :

   -   static parseDouble ???

- Font :

   -   Font(String name, int style, int size)
   name :
       -   "Arial"
       -   "Courier"
       -   "Tahoma"
       -   "Times New Roman"
   type :
       -   Font.BOLD           /* fett             */
       -   Font.ITALIC         /* kursiv           */
       -   Font.PLAIN          /* unterstrichen ?  */
       -   Font.ROMAN_BASELINE /* unterstrichen ?  */

- Integer :

   -   parseInt ???

- LayoutManager :

   -   BorderLayout
       -   BorderLayout()
       -   BorderLayout(int hgap, int vgap)
   -   FlowLayout
       -   FlowLayout()
       -   FlowLayout(int align)
       -   FlowLayout(int align, int hgap, int vgap)
       align :
           -   FlowLayout.LEFT
           -   FlowLayout.CENTER
           -   FlowLayout.RIGHT
   -   GridLayout
       -   GridLayout()
       -   GridLayout(int rows, int cols)
       -   GridLayout(int rows, int cols, int hgap, int vgap)

- Listener :

   -   implements ActionListener
       -   public void actionPerformed(ActionEvent e)
       ActionEvent :
           -   public String getActionCommand()
           -   public Object getSource()
   -   implements ChangeListener
       -   public void stateChanged(ChangeEvent e)
       ChangeEvent :
           -   public Object getSource()
   -   implements ItemListener
       -   public void itemStateChanged(ItemEvent e)
       ItemEvent :
           -   public Object getSource()
   -   implements MouseListener
       -   public void mouseClicked(MouseEvent e)  /* beim Klicken     */
       -   public void mouseEntered(MouseEvent e)  /* beim Eintreten   */
       -   public void mouseExited(MouseEvent e)   /* beim Verlassen   */
       -   public void mousePressed(MouseEvent e)  /* beim Pressen     */
       -   public void mouseReleased(MouseEvent e) /* beim Loslassen   */
       ->  extends MouseAdapter                    
           /*  Um nicht alle obigen Methoden des MouseListeners schreiben zu müssen,
               kann man einfach von der Klasse MouseAdapter ableiten 
               und nur die benötigte Methode überschreiben. */
       MouseEvent :
           -   public Object getSource()

- String :

   -   replace ???
   -   format ???

- Swing :

   -   JButton
       -   JButton(String text)
       -   public void addActionListener(ActionListener l)
       -   public void addItemListener(ItemListener l)
       -   public void addMouseListener(MouseEvent l)
       -   public void setMnemonic(int mnemonic)
       -   ???
   -   JCheckBox
       -   JCheckBox(String text, boolean selected)
       -   public void   addActionListener(ActionListener l)
       -   public void   addItemListener(ItemListener l)
       -   public void   addMouseListener(MouseEvent l)
       -   public String getActionCommand()
       -   public void   setActionCommand(String aCommand)
       -   ???
   -   JComboBox
       -   JComboBox(Object[] items)   /* Object = array */
       -   JComboBox(Vector<?> items)
       -   public void     addActionListener(ActionListener l)
       -   public void     addItem(Object anObject)
       -   public void     addItemListener(ItemListener l)
       -   public void     addMouseListener(MouseEvent l)
       -   public String   getActionCommand()
       -   public Object   getItemAt(int index)
       -   public int 	    getSelectedIndex()
       -   public Object   getSelectedItem()
       -   public Object[] getSelectedObjects()
       -   public void     setActionCommand(String aCommand)
   -   JFrame
       -   JFrame()
       -   JFrame(String title)
       -   public void      add(/* ??? */)
       -   public void      add(..., BorderLayout.CENTER)/* default */
       -   public void      add(..., BorderLayout.EAST)
       -   public void      add(..., BorderLayout.NORTH)
       -   public void      add(..., BorderLayout.SOUTH)
       -   public void      add(..., BorderLayout.WEST)
       -   public Container getContentPane()
       -   public String    getTitle()
       -   public void      pack()
       -   public void      setLayout(LayoutManager manager)    /* default = BorderLayout */
       -   public void      setLocation(int x, int y)
       -   public void      setResizable(boolean resizable)
       -   public void      setSize(Dimension d)
       -   public void      setSize(int width, int height)
       -   public void      setTitle(String title)
       -   public void      setVisible(boolean b)
   -   JLabel
       -   JLabel()
       -   JLabel(String text)
       -   JLabel(String text, int horizontalAlignment)
       horizontalAlignment :
           -   LEFT
           -   CENTER
           -   RIGHT
       -   public void   addMouseListener(MouseListener l)
       -   public String getText()
       -   public void   setFont(Font font)
       -   public void   setForeground(Color fg)
       -   public void   setPreferredSize(Dimension preferredSize)
       -   public void   setText(String text)
   -   JPanel
       -   JPanel()
       -   public void  add(/* ??? */)
       -   public void  addMouseListener(MouseListener l)
       -   public Color getBackground()
       -   public void  setBackground(Color bg)
       -   public void  setPreferredSize(Dimension preferredSize)
   -   JRadioButton
       -   JRadioButton()
       -   JRadioButton(String text)
       -   JRadioButton(String text, boolean selected)
       -   public void   addActionListener(ActionListener l)
       -   public void   addItemListener(ItemListener l)
       -   public void   addMouseListener(MouseListener l)
       -   public String getActionCommand()
       -   public String getText()
       -   public void   setActionCommand(String actionCommand)
       -   public void   setForeground(Color fg)
       -   public void   setPreferredSize(Dimension preferredSize)
       -   public void   setSelected(boolean b)
       -   public void   setText(String text)
   -   JTextField
       -   JTextField(int columns)
       -   JTextField(String text)
       -   JTextField(String text, int columns)
       -   public void   addActionListener(ActionListener l)
       -   public void   addMouseListener(MouseListener l)
       -   public String getText()
       -   public void   setActionCommand(String command)
       -   public void   setEditable(boolean b)
       -   public void   setHorizontalAlignment(int alignment)
       -   public void   setText(String text)

Startseite
Zurück

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random wikia