java - How to make JCombobox look like a JTextField -
Is JCombobox a good (and easy) way to look like JTextField? By this I mean that there should not be a dropdown button, but when the user enters something then he should show the best results.
Actually Google works just like youtube, facebook, and so on.
jesimbobox combo box = new jcmobox (); ComboBox.setUI (new BasicCobbox UI () {@Override protected JButton createArrowButton () {New Zbutton Return} {@ Override Public Entity () {Return 0;}};}}); Make sure to make return 0: A) Button is not shown - b) Any place is not reserved for it, you can type in the entire area <
I have found that I had to type .setUI () via SwingUtilities.invokeLater () , but depending on the structure of your code, Maybe you do not have this.
If you want to auto-complete, add some items in the combo box and use This may seem strange to your box when you use the second L & F, then you have to choose which instantiator you need to instantiate the UI. If you do not want to display drop-down if nothing is in the combo box, then override this method in BasicComboBoxUI: AutoCompleteDecorator.decorate (comboBox) . The AutoCompleteDecorator is part of the class, as mentioned earlier.
@ Override Public Zero Set popup widget (JComboBox c, boolean v) {// There is nothing in the combo box if popup keeps coming down if (c.getItemCount ()> gt; {super.setPopupVisible (c, v); }}
Comments
Post a Comment