Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.github.material-ui-swing:JTextFieldPlaceholder

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.github.material-ui-swing:JTextFieldPlaceholder

Simple Swing component with placeholder called JTextFieldPlaceholder

  • 0.0.2-rc1
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

JTextFieldPlaceholder

Maven Central

Simple Swing component with placeholder called JTextFieldPlaceholder

TODO

This component has bad design, in the future should introduce the following effect

  • Used a personal UI component as BasicTextFieldPlaceholderUI
  • Introduce a toggle button with an icon
  • Introduce rules to check the errors inside the text field and paint the line with an error color

Code Style

We live in a world where robots can drive a car, so we shouldn't just write code, we should write elegant code.

This repository use google-java-format to maintains the code of the repository elegant, so before submit the code check the Java format with the following command on the root of the directory

./gradlew verifyGoogleJavaFormat

It any error are reported please run the following command to try to fix it

./gradlew googleJavaFormat

p.s: The gradle plugin work with all the JDK version >= 9 (or better with java byte code version compatible with the version 55.0)

For more details about the JDK support see the this issue and to know more about the Google Java code Style see the this reference

Actual Style

Example with code

JTextFieldPlaceholder passwordFieldForm = new JTextFieldPlaceholder(new JPasswordField());
passwordFieldForm.setPlaceholderText("Password")
                .setIcon(
                        MaterialImageFactory.getInstance().getImage(
                                GoogleMaterialDesignIcons.VISIBILITY_OFF
                        ))
                .setSelectedIcon(
                        MaterialImageFactory.getInstance().getImage(
                                GoogleMaterialDesignIcons.VISIBILITY,
                                MaterialColors.LIGHT_BLUE_400
                        )
                )
                .setDimension(150, 35)
                .addAction(new AbstractAction() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        JPasswordField passwordField = (JPasswordField) passwordFieldForm.getTextFiled();
                        if (!passwordFieldForm.isSelected()) {
                            passwordField.setEchoChar((char) UIManager.get("PasswordField.echoChar"));
                        } else {
                            passwordField.setEchoChar((char) 0);
                        }
                    }
                });

In this example is use material-ui-swing library, you can set all type icon you want, by default there are two icons, as:

List of projects that used this component

Author

This component is developer by @vincenzopalazzo

In addition, this component is developed in collaborations with Arizona State University.

FAQs

Package last updated on 24 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc