Example usage for javax.swing JTextField setNavigationFilter

List of usage examples for javax.swing JTextField setNavigationFilter

Introduction

In this page you can find the example usage for javax.swing JTextField setNavigationFilter.

Prototype

public void setNavigationFilter(NavigationFilter filter) 

Source Link

Document

Sets the NavigationFilter.

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    JTextField textField = new JTextField("Prefix_", 20);
    textField.setNavigationFilter(new NavigationFilterPrefixWithBackspace(7, textField));
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(textField);
    frame.pack();//from   ww w.j av a2 s  .  c  om
    frame.setVisible(true);
}