Skip to end of metadata
Go to start of metadata

By default, FEST-Swing supports looking up components by name, type and custom search criteria. To specify custom search criteria, users need to provide an implementation of GenericTypeMatcher or ComponentMatcher.

To save development time, FEST-Swing provides some common-use component matchers in the package org.fest.swing.core.matcher:

Matcher

Description

DialogMatcher

Matches a Dialog containing the specified name, title or visibility

FrameMatcher

Matches a Frame containing the specified name, title or visibility

JButtonMatcher

Matches a JButton containing the specified name, text or visibility

JLabelMatcher

Matches a JLabel containing the specified name, text or visibility

JTextComponentMatcher

Matches a JTextComponent containing name, text or visibility

Example

The following example shows how to find and click a JButton with name "cancel" and text "Cancel", in a JFrame using a JButtonMatcher:

Labels