mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
Extras: added support for client property JTextField.padding (for commit a9dcf09d13)
This commit is contained in:
@@ -18,6 +18,7 @@ package com.formdev.flatlaf.extras.components;
|
|||||||
|
|
||||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.awt.Insets;
|
||||||
import javax.swing.JFormattedTextField;
|
import javax.swing.JFormattedTextField;
|
||||||
import com.formdev.flatlaf.extras.components.FlatTextField.SelectAllOnFocusPolicy;
|
import com.formdev.flatlaf.extras.components.FlatTextField.SelectAllOnFocusPolicy;
|
||||||
|
|
||||||
@@ -61,6 +62,27 @@ public class FlatFormattedTextField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the padding of the text.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public Insets getPadding() {
|
||||||
|
return (Insets) getClientProperty( TEXT_FIELD_PADDING );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies the padding of the text.
|
||||||
|
* This changes the location and size of the text view within the component bounds,
|
||||||
|
* but does not affect the size of the component.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public void setPadding( Insets padding ) {
|
||||||
|
putClientProperty( TEXT_FIELD_PADDING, padding );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns minimum width of a component.
|
* Returns minimum width of a component.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.formdev.flatlaf.extras.components;
|
|||||||
|
|
||||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.awt.Insets;
|
||||||
import javax.swing.JPasswordField;
|
import javax.swing.JPasswordField;
|
||||||
import com.formdev.flatlaf.extras.components.FlatTextField.SelectAllOnFocusPolicy;
|
import com.formdev.flatlaf.extras.components.FlatTextField.SelectAllOnFocusPolicy;
|
||||||
|
|
||||||
@@ -61,6 +62,27 @@ public class FlatPasswordField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the padding of the text.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public Insets getPadding() {
|
||||||
|
return (Insets) getClientProperty( TEXT_FIELD_PADDING );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies the padding of the text.
|
||||||
|
* This changes the location and size of the text view within the component bounds,
|
||||||
|
* but does not affect the size of the component.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public void setPadding( Insets padding ) {
|
||||||
|
putClientProperty( TEXT_FIELD_PADDING, padding );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns minimum width of a component.
|
* Returns minimum width of a component.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.formdev.flatlaf.extras.components;
|
|||||||
|
|
||||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.awt.Insets;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,6 +64,27 @@ public class FlatTextField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the padding of the text.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public Insets getPadding() {
|
||||||
|
return (Insets) getClientProperty( TEXT_FIELD_PADDING );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies the padding of the text.
|
||||||
|
* This changes the location and size of the text view within the component bounds,
|
||||||
|
* but does not affect the size of the component.
|
||||||
|
*
|
||||||
|
* @since 1.4
|
||||||
|
*/
|
||||||
|
public void setPadding( Insets padding ) {
|
||||||
|
putClientProperty( TEXT_FIELD_PADDING, padding );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns minimum width of a component.
|
* Returns minimum width of a component.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user