Menu
  • HOME
  • TAGS

How do I use SwingX's Highlighter to return a different renderer component?

java,swing,swingx,highlighter

If you have a look at JRendererLabel, you will see that invalidate, revalidate, validate (and a bunch of other methods) have been set to "no operation", meaning that they no longer make notifications to the layout manager that the component should be laid out. This is done to help improve...

JDatePicker date formatting

java,swing,swingx

http://www.codejava.net/java-se/swing/how-to-use-jdatepicker-to-display-calendar-component Here might be a resource that can help I believe you might need to call datePicker.getJFormattedTextField().getText() ...

Implementing a custom combo box model failed to override some methods

java,swing,jcombobox,swingx,comboboxmodel

I have managed to figure it out. Thanks a bunch. package PiggeryManagementSystem; import java.util.ArrayList; import javax.swing.MutableComboBoxModel; import javax.swing.event.ListDataListener; /** * @author Stanchart */ public class MyComboBoxModel implements MutableComboBoxModel { private Object selectedItem; ArrayList <String> columns = new ArrayList(); public MyComboBoxModel( ArrayList<String> c) { this.columns = c; } @Override public void...

create an transparent rectangle over blurred background in jframe

java,swing,graphics2d,swingx,glasspane

I'm trying to make heads and tails of your code... You fail to call super.paintComponent...this could lead you into a same serious issues if you're not careful. General rule of thumb, just call it ;) Be careful when modifiying the state of a Graphics context, for example... g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Will...

Override Nimbus Colors

java,swing,look-and-feel,swingx,nimbus

see whats happens, Win8.1 64b, Java7, JDK 1.7_021, by using full rectangle Painter, import java.awt.*; import java.util.Vector; import javax.swing.*; import javax.swing.UIManager; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.nimbus.AbstractRegionPainter; public class MyComboBox { private Vector<String> listSomeString = new Vector<String>(); private JComboBox someComboBox = new JComboBox(listSomeString); private JComboBox editableComboBox = new JComboBox(listSomeString); private JComboBox...

CellContext.isExpanded() returns always true in JXTreeTable

java,swing,swingx,jxtreetable

The solution can be implemented based on the answer of dic19. The solution is to implement a special renderer with a getTableCellRendererComponent method that checks for a JXTreeTable. In such a case it is evaluated if the row is expanded. The check for the leaf flag may be added also....

Java date and age

java,date,calendar,simpledateformat,swingx

You shouldn't write any loop to add 60 years to your date. You can get a selected date from your JXDatePicker and do it like that: final Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.YEAR, 60); final Date retirementDate = cal.getTime(); ...

Getting a class not found error on org/jdesktop/swingx/plaf/ComponentAddon

java,swingx

Turns out I downloaded the wrong jar. Shouldv'e downloaded swingx-all.

JXDatePicker questions (Part 1)

java,swingx

(1) How to clear the "Today is [today date]"? Use JXDatePicker#setLinkPanel and supply what ever you want... (2) How to show the current date in dd-MM-YYYY before I click the datepicker choose calendar? Use JXDatePicker#setFormats (3) How to change the icon of the button? You can change the popup...

Closing Jform in the constructor

java,swing,netbeans,swingx,jform

do something like this public class OrderGUI extends javax.swing.JFrame { public OrderGUI(Customer cust, Date dt, Time t) throws FileNotFoundException, IOException, ClassNotFoundException { this(); } @Override public void setVisible(boolean val){ if(!condition){ super.setVisible(val); } } } ...

Setting a Minimum Date for JXDatePicker in a JTable column

java,swing,jtable,swingx

The JXDatePicker field has protected access, you'll have to extend DatePickerCellEditor and provide that functionality... public class BoundDatePickerCellEditor extends DatePickerCellEditor { public BoundDatePickerCellEditor() { super(); } public BoundDatePickerCellEditor(DateFormat dateFormat) { super(dateFormat); } public void setLowerBound(Date date) { datePicker.getMonthView().setLowerBound(date); } public void setUpperBound(Date date) { datePicker.getMonthView().setLowerBound(date); } } Runnable example... import...

JXDatePicker questions (part 2)

java,swing,swingx,jcalendar

The date format is wrong, it should be yyyy-MM-dd Use JXDatePicker#getMonthView#setMonthStringBackground Use JXDatePicker#getMonthView#setSelectionBackground. If you want to change the color use to "highlight" today, you can also use JXDatePicker#getMonthView#setTodayBackground - but it only colors the border of the box when today is not highlighted... ...

Remove selected node from JTreeTable SwingX error

java,swingx,jtreetable

You are trying to remove the child directly from another node, bypassing the TreeTableModel. Use DefaultTreeTableModel.removeNodeFromParent, e.g: public void removeChildren(int index) { MutableTreeTableNode node = root.getChildAt(index); this.removeNodeFromParent(node); } ...

Why is JXTable losing input where JTable is not?

java,swing,jtable,swingx,jxtable

While debugging the JXTable and the JTable I found the reason for the loss of CellEdits. The difference is in the method columnMarginChanged(): JXTable: if (isEditing()) { removeEditor(); } JTable: if (isEditing() && !getCellEditor().stopCellEditing()) { getCellEditor().cancelCellEditing(); } At first I thought the removeEditor() method is an enhancement of the JTable......