Extreme Component Documentation

Table Of Contents

One question about calendar. I saw in the sample that the calendar control can be used as a drop down button to select the date. How do I set this as a property in Netbeans so the calendar changes from the default view to a drop down button?
You can just drag a AComboBox component into your form, then set it's value class to Date.class, you can get the JCalendar work with the drop down button.

    http://www.zfqjava.com/docs/api/com/zfqjava/swing/AComboBox.html

Invoke the method AComboBox.setValueClass(Date.class);
You can use the following code:

    AComboBox comboBox = new AComboBox();
    comboBox.setValueClass(Date.class);
Do you have a recommended way of hiding "My Network Places" from the JDirChooser tree under Windows?
The JDirChooser component have a method named "setFileFilter", you can use a FileFilter to filter out the folder you wanted.

  http://www.zfqjava.com/docs/api/com/zfqjava/swing/JDirChooser.html
There is the possibility of color only one day of the month?
The BasicCalendarUI class has provide the following
API since JCalendar 1.4:

	public JTable getTable(int month);

You can get the JTable for the specified month,
and set a cell renderer for it. It can works
as you expected.
I can highlight a single day of the month, not a year?
You can, change the two line code in CalendarDemo.java,
see comment area in the following code start with "//"

  private static class DefaultAttributesProvider implements AttributesProvider  {

  private SimpleAttributeSet a;
        private SimpleAttributeSet disabledA;
	private JCalendar calendar;
	public DefaultAttributesProvider(JCalendar calendar) {
		// add this code
		this.calendar = calendar;
	    a = new SimpleAttributeSet();
	    StyleConstants.setForeground(a, Color.red);
	    StyleConstants.setBackground(a, Color.yellow);
            disabledA = new SimpleAttributeSet();
            StyleConstants.setForeground(disabledA, Color.WHITE);
	    StyleConstants.setBackground(disabledA, Color.LIGHT_GRAY);
	}
	public AttributeSet getAttributes(Object value) {
	    if(value != null) {
		// add this code
		if(calendar.getYear() != 2007) {
        	return;
		}
		int day = ((Integer)value).intValue();
                switch(day) {
                    case 1:
                    case 3:
                    case 5:
                    case 7:
                    case 23:
                        return a;
                    case 13:
                        if(CalendarDemo.filterSelection) {
                            return disabledA;
                        }
                }
	    }
	    return null;
	}
    }
Can highlight the color of a day to pressure the mouse?
his feature can be customized by adding a cell renderer.
Can intercept a single click of the mouse to realize that day has been selected? (Works with 2 click)
Use the code: JCalendar.setActionClickCount(2);
JListView component, how to get the component to redraw now the I have actually loaded the image and it is ready!
 Follow the instructions:
1.You can get the JList or JTable component:
    JList list = ((BasicListViewUI)listView.getUI()).getList();
2.Find the index in JList model for the specified image:
    int index = 3; // for example
3.Refersh the specified bounds for the specified index.
   Rectangle bounds = list.getCellBounds(index, index);
   list.repaint(bounds);
How to enable the color effect for print preview?
JPrintPreview provides the following methods to enable color print preview:
JPrintPreview.setColorType(JPrintPreview.COLOR);
If i hide a header column (f.i. "Date") and the change the source folder for the listview, the prior hided column is shown again. Is there any way to _get/set_ the columns which should be shown, that the listview remembers these columns?
Because every times, JTable always repopulate all columns when set a new model, you can disable the auto column create after set the first column by invoke the following code:

     table.setAutoCreateColumnsFromModel(false);
How to set a Renderer for AComboBox that aligns the text on the left?
You can use the "ObjectCellRenderer" in com.zfqjava.swing.cell directly, it has method
     "setDefaultHorizontalAlignment" and "setDefaultVerticalAlignment".
How do I set the format of the renderer to format the date in short form: MM/DD/YYYY?
You can create "DateCellRenderer" instance, it's ObjectCellRenderer subclass,
and pass a new SimpleDateFormat("MM/dd/yyyy");
If there is a way to populate the tree in your JDirChooser with a specific JList of files.I mean not the files physically on the computer ...It could permit the user to select a directory which is not on his own machine but on another system which is not directly accessible.
Create JDirChooser with a "javax.swing.filechooser.FileSystemView", so which you need is write a class extends "FileSystemView" and provides the files you what to create.
Does a license include source code?
The 1 Source Code License includes all source code.
Is there any way to change the size of the dir chooser dialog when showDialog is called?
Subclass the JDirChooser and overide the method:

    protected JDialog createDialog(Component parent, 
	   String msg, 
	   Icon icon, 
	   String title,
	   JDirChooser dirChooser, 
	   ActionListener okListener,
	   ActionListener cancelListener) {
        JDialog dialog = super.createDialog(parent, 
		    msg, 
		    icon, 
		    title,	 
		    dirChooser, 
		    okListener,
		    cancelListener);
        // you code here
	dialog.setSize(120, 400);
    	return dialog;
    }  

I'm interested in the JLinkButton, but I want to know more about how it launches an external browser... Can you tell me more about what it does to determine the browser on each platform (particularly Windows, Solaris and Linux) and how it launches them? Also, is there just a utility class that I can use to programmtically launch a URL in a browser without using the Button UI element?
Yes, you can use some utilities class to launch URL, the utilities class includes in the JLinkButton package, but for some Application environment, such as Applet, some methods rely JLinkButton container information, The utilities class also include some methods to launch URL in Application environment, you can use it directly. Determines the platform in Java, it seems only via the System properties "os.name", launch commend is different on every platform.
im interested in your JCalendar, but in demo version i didnt see multiple date and date range selection (using mouse, ctr, shift and shift+ctrl combinations).
Current the JCalendar component based on JTable, and the mutiple selection is easy to implements, but the default is single selection, if you want this feature, and i will add some property to do this!
CAn I use Jcalendar with jdk1.1.8
The JCalendar requires jdk 1.3 or later. And the current implements based on the JTable component, if you use it in jdk1.1.8, should add swing package for that version, and I have not test it in that environment.
Do you sell it per developer or is only one license needed or is it per client licensing?
At present, we sell our products for Binary License or Source Code License, The product only can license for single developer or single company, but can be used for all applications that developed by the single entity.
Is the "as-is" jar fully compatible with Swing and all the current widgets, i.e., drop-down boxes, form fields, push buttons, etc.?
The component is 100% compatible with Swing components.
Do you allow users to freely distribute your jar embedded within user products or is there a royalty fee?
The component is free to distribute with your products for unlimited users, And for unlimited products that developed by your company.
Am I allowed to make changes to the source code if I purchase it?
The component and source code can be used or modified by your company, but should not sell or distribute it to others.
What does the source code purchase give me?
The source code license includes all source code for that component.

 

One question about calendar. I saw in the sample that the calendar control can be used as a drop down button to select the date. How do I set this as a property in Netbeans so the calendar changes from the default view to a drop down button?
You can just drag a AComboBox component into your form, then set it's value class to Date.class, you can get the JCalendar work with the drop down button.

    http://www.zfqjava.com/docs/api/com/zfqjava/swing/AComboBox.html

Invoke the method AComboBox.setValueClass(Date.class);
You can use the following code:

    AComboBox comboBox = new AComboBox();
    comboBox.setValueClass(Date.class);
Do you have a recommended way of hiding "My Network Places" from the JDirChooser tree under Windows?
The JDirChooser component have a method named "setFileFilter", you can use a FileFilter to filter out the folder you wanted.

  http://www.zfqjava.com/docs/api/com/zfqjava/swing/JDirChooser.html
There is the possibility of color only one day of the month?
The BasicCalendarUI class has provide the following
API since JCalendar 1.4:

	public JTable getTable(int month);

You can get the JTable for the specified month,
and set a cell renderer for it. It can works
as you expected.
I can highlight a single day of the month, not a year?
You can, change the two line code in CalendarDemo.java,
see comment area in the following code start with "//"

  private static class DefaultAttributesProvider implements AttributesProvider  {

  private SimpleAttributeSet a;
        private SimpleAttributeSet disabledA;
	private JCalendar calendar;
	public DefaultAttributesProvider(JCalendar calendar) {
		// add this code
		this.calendar = calendar;
	    a = new SimpleAttributeSet();
	    StyleConstants.setForeground(a, Color.red);
	    StyleConstants.setBackground(a, Color.yellow);
            disabledA = new SimpleAttributeSet();
            StyleConstants.setForeground(disabledA, Color.WHITE);
	    StyleConstants.setBackground(disabledA, Color.LIGHT_GRAY);
	}
	public AttributeSet getAttributes(Object value) {
	    if(value != null) {
		// add this code
		if(calendar.getYear() != 2007) {
        	return;
		}
		int day = ((Integer)value).intValue();
                switch(day) {
                    case 1:
                    case 3:
                    case 5:
                    case 7:
                    case 23:
                        return a;
                    case 13:
                        if(CalendarDemo.filterSelection) {
                            return disabledA;
                        }
                }
	    }
	    return null;
	}
    }
Can highlight the color of a day to pressure the mouse?
his feature can be customized by adding a cell renderer.
Can intercept a single click of the mouse to realize that day has been selected? (Works with 2 click)
Use the code: JCalendar.setActionClickCount(2);
JListView component, how to get the component to redraw now the I have actually loaded the image and it is ready!
 Follow the instructions:
1.You can get the JList or JTable component:
    JList list = ((BasicListViewUI)listView.getUI()).getList();
2.Find the index in JList model for the specified image:
    int index = 3; // for example
3.Refersh the specified bounds for the specified index.
   Rectangle bounds = list.getCellBounds(index, index);
   list.repaint(bounds);
How to enable the color effect for print preview?
JPrintPreview provides the following methods to enable color print preview:
JPrintPreview.setColorType(JPrintPreview.COLOR);
If i hide a header column (f.i. "Date") and the change the source folder for the listview, the prior hided column is shown again. Is there any way to _get/set_ the columns which should be shown, that the listview remembers these columns?
Because every times, JTable always repopulate all columns when set a new model, you can disable the auto column create after set the first column by invoke the following code:

     table.setAutoCreateColumnsFromModel(false);
How to set a Renderer for AComboBox that aligns the text on the left?
You can use the "ObjectCellRenderer" in com.zfqjava.swing.cell directly, it has method
     "setDefaultHorizontalAlignment" and "setDefaultVerticalAlignment".
How do I set the format of the renderer to format the date in short form: MM/DD/YYYY?
You can create "DateCellRenderer" instance, it's ObjectCellRenderer subclass,
and pass a new SimpleDateFormat("MM/dd/yyyy");
If there is a way to populate the tree in your JDirChooser with a specific JList of files.I mean not the files physically on the computer ...It could permit the user to select a directory which is not on his own machine but on another system which is not directly accessible.
Create JDirChooser with a "javax.swing.filechooser.FileSystemView", so which you need is write a class extends "FileSystemView" and provides the files you what to create.
Does a license include source code?
The 1 Source Code License includes all source code.
Is there any way to change the size of the dir chooser dialog when showDialog is called?
Subclass the JDirChooser and overide the method:

    protected JDialog createDialog(Component parent, 
	   String msg, 
	   Icon icon, 
	   String title,
	   JDirChooser dirChooser, 
	   ActionListener okListener,
	   ActionListener cancelListener) {
        JDialog dialog = super.createDialog(parent, 
		    msg, 
		    icon, 
		    title,	 
		    dirChooser, 
		    okListener,
		    cancelListener);
        // you code here
	dialog.setSize(120, 400);
    	return dialog;
    }  

I'm interested in the JLinkButton, but I want to know more about how it launches an external browser... Can you tell me more about what it does to determine the browser on each platform (particularly Windows, Solaris and Linux) and how it launches them? Also, is there just a utility class that I can use to programmtically launch a URL in a browser without using the Button UI element?
Yes, you can use some utilities class to launch URL, the utilities class includes in the JLinkButton package, but for some Application environment, such as Applet, some methods rely JLinkButton container information, The utilities class also include some methods to launch URL in Application environment, you can use it directly. Determines the platform in Java, it seems only via the System properties "os.name", launch commend is different on every platform.
im interested in your JCalendar, but in demo version i didnt see multiple date and date range selection (using mouse, ctr, shift and shift+ctrl combinations).
Current the JCalendar component based on JTable, and the mutiple selection is easy to implements, but the default is single selection, if you want this feature, and i will add some property to do this!
CAn I use Jcalendar with jdk1.1.8
The JCalendar requires jdk 1.3 or later. And the current implements based on the JTable component, if you use it in jdk1.1.8, should add swing package for that version, and I have not test it in that environment.
Do you sell it per developer or is only one license needed or is it per client licensing?
At present, we sell our products for Binary License or Source Code License, The product only can license for single developer or single company, but can be used for all applications that developed by the single entity.
Is the "as-is" jar fully compatible with Swing and all the current widgets, i.e., drop-down boxes, form fields, push buttons, etc.?
The component is 100% compatible with Swing components.
Do you allow users to freely distribute your jar embedded within user products or is there a royalty fee?
The component is free to distribute with your products for unlimited users, And for unlimited products that developed by your company.
Am I allowed to make changes to the source code if I purchase it?
The component and source code can be used or modified by your company, but should not sell or distribute it to others.
What does the source code purchase give me?
The source code license includes all source code for that component.