Here you can find the source of isFocusable(Component component)
Parameter | Description |
---|---|
component | a parameter |
public static boolean isFocusable(Component component)
//package com.java2s; /*/*from w w w . ja va 2s . c o m*/ * Copyright (c) 2007 Agile-Works * All rights reserved. * * This software is the confidential and proprietary information of * Agile-Works. ("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you * entered into with Agile-Works. */ import javax.swing.*; import javax.swing.text.JTextComponent; import java.awt.*; public class Main { /** * Return true if the jComponent could receive the focus * * @param component * @return */ public static boolean isFocusable(Component component) { if (component instanceof JTextComponent || component instanceof JComboBox || component instanceof JCheckBox || component instanceof JTable) { return true; } return false; } }