public final class GuiUtils extends Object
Constructor and Description |
---|
GuiUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
cancelEditing(JTable table)
cancel any editing that is currently being done on the table.
|
static void |
copyTextToClipboard(String text)
Copy text to clipboard
|
static JComponent |
createLabelCombo(String label,
JComboBox<?> comboBox)
Create a GUI component JLabel + JComboBox with a left and right margin (5px)
|
static <C extends JComponent> |
emptyBorder(C comp)
Clears border of the given component.
|
static void |
fixSize(TableColumn column,
JTable table)
Fix the size of a column according to the header text.
|
static String |
getPastedText()
Get pasted text from clipboard
|
static void |
makeScrollableMenu(JMenu menu)
Make menu scrollable
|
static JScrollPane |
makeScrollPane(Component comp)
Create a scroll panel that sets its preferred size to its minimum size.
|
static void |
stopTableEditing(JTable table)
Stop any editing that is currently being done on the table.
|
public static JScrollPane makeScrollPane(Component comp)
comp
- the component which should be placed inside the scroll panepublic static <C extends JComponent> C emptyBorder(C comp)
C
- component typecomp
- input componentpublic static void fixSize(TableColumn column, JTable table)
column
- to be resizedtable
- containing the columnpublic static JComponent createLabelCombo(String label, JComboBox<?> comboBox)
label
- the labelcomboBox
- the combo boxpublic static void stopTableEditing(JTable table)
table
- the table to stop on editingpublic static void cancelEditing(JTable table)
table
- the table to cancel on editingpublic static String getPastedText() throws UnsupportedFlavorException, IOException
UnsupportedFlavorException
- if the clipboard data can not be get as a String
IOException
- if the clipboard data is no longer availablepublic static void makeScrollableMenu(JMenu menu)
menu
- JMenu
public static final void copyTextToClipboard(String text)
text
- Text to copyCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.