This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: get user input gray textbox
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 20, 2008
05:36 AM
get user input gray textbox
Hi,
In the advanced get user input, I want to add a check box and a text field, and I want the text filed to be available only if the text box has been checked, otherwise I want it to be grayed out.
any one knows on a good way to do it?
I'm using Installanywhere 2008 VP1
thanks
Alon
In the advanced get user input, I want to add a check box and a text field, and I want the text filed to be available only if the text box has been checked, otherwise I want it to be grayed out.
any one knows on a good way to do it?
I'm using Installanywhere 2008 VP1
thanks
Alon
(10) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 20, 2008
10:01 AM
i would recommend you to go for custom code panels..
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 20, 2008
01:10 PM
but I guess there is no other way...
any clue on how to do it?
any clue on how to do it?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
03:32 AM
Hi
The most obious way to do this is to add ItemListener to JCheckBox. Unfortunately I do not know how these Listeners work in InstallAnywhere (See the other thread).
The most obious way to do this is to add ItemListener to JCheckBox. Unfortunately I do not know how these Listeners work in InstallAnywhere (See the other thread).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
03:39 AM
hi thanks for the help
what other thread did you mean?about listeners?
what other thread did you mean?about listeners?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
04:13 AM
I started another thread but It has not appeared yet. I guess a moderator needs to approve it first.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
04:18 AM
oh o.k I'll wait.
does a listener can make a text filed to appear gray if not wanted?
does a listener can make a text filed to appear gray if not wanted?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
04:25 AM
There are two issues here.
1. Detect a change in checkbox values.
2. Turn textfield to grey
Listener would just detect that someone has changed the checkbox value. Then you could write the code that turns the textfield to grey. e.g
MyText.setEditable(false);
Perhaps there is an easier way. I am new to InstallAnywhere.
1. Detect a change in checkbox values.
2. Turn textfield to grey
Listener would just detect that someone has changed the checkbox value. Then you could write the code that turns the textfield to grey. e.g
MyText.setEditable(false);
Perhaps there is an easier way. I am new to InstallAnywhere.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
04:34 AM
Juhana wrote:
I started another thread but It has not appeared yet. I guess a moderator needs to approve it first.
Offtopic:
FYI AFAIK normally there is no moderation here in the sense of a message needing approval (i.e. there is no action BEFORE posting, most of the time it's action AFTER posting, if for instance a post has been tagged as spam or for instance if your post has been duplicated).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
07:52 AM
The following code should do it. There is a small issue with back button but I do not know how to fix it yet.
You just need to unzip IAClasses.zip to somewhere and put this into a classpath (e.g. C:\Java).
then just type
javac -classpath C:\Java CustomCodePanelTemplate.java
jar -cvfM CustomCodePanelTemplate.jar CustomCodePanelTemplate.class
Then you should haveCustomCodePanelTemplate.jar -file. Add this jar file to
Custom code panel and type in the class CustomCodePanelTemplate.
It should work. See the back button functionality and see if it is ok (there might be some confusion). If you can fix it then please tell me.
You just need to unzip IAClasses.zip to somewhere and put this into a classpath (e.g. C:\Java).
then just type
javac -classpath C:\Java CustomCodePanelTemplate.java
jar -cvfM CustomCodePanelTemplate.jar CustomCodePanelTemplate.class
Then you should haveCustomCodePanelTemplate.jar -file. Add this jar file to
Custom code panel and type in the class CustomCodePanelTemplate.
It should work. See the back button functionality and see if it is ok (there might be some confusion). If you can fix it then please tell me.
//package com.acme; // you should change this to your own package location
import java.awt.*;
import com.zerog.ia.api.pub.*;
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
public class CustomCodePanelTemplate extends CustomCodePanel implements ItemListener
{
//Constructor
public CustomCodePanelTemplate (){
selected=false;
}
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy)
{
//Get the frame (window that displays all stuff)
ccpp = customCodePanelProxy;
gui = (GUIAccess)customCodePanelProxy.getService(com.zerog.ia.api.pub.GUIAccess.class);
frame = gui.getFrame();
//put components
label1 = new JLabel("Here is some instruction text....");
label1.setFont((label1.getFont()).deriveFont(14));
panel=new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.setBackground(new Color(255,255,255));
panel.add(label1);
check = new JCheckBox ("Click here to activate the text field",selected);
check.setBackground(new Color(255,255,255));
panel.add(check);
field =new JTextField(20);
field.setEditable(selected);
field.setBorder(BorderFactory.createLineBorder(new Color(0,0,0)));
panel.add(field);
label2 = new JLabel("Here is some instruction text again....");
label2.setFont((label1.getFont()).deriveFont(14));
panel.add(label2);
add(BorderLayout.NORTH,panel);
//Add the listener
check.addItemListener(this);
//This might be useless
if (selected==true)
field.setEditable(true);
else
field.setEditable(false);
return true; // true if you want your panel displayed or false if not
}
public void panelIsDisplayed()
{
}
public boolean okToContinue()
{
return true; // or false
}
public String getTitle()
{
return "Some Title";
}
//Listener code is here
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange()==1) {
field.setEditable(true);
selected=true;
}
else{
field.setEditable(false);
selected=false;
}
}
//Components
private boolean selected;
private JLabel label1,label2;
private Frame frame;
private JPanel panel;
private JTextField field;
private JCheckBox check;
GUIAccess gui;
CustomCodePanelProxy ccpp;
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
09:05 AM
Thank you very much it seems to work fine.(didn't test the back button though)
Any idea on how to change the design to match the default installanywhere panels(e.g textfield doesn't look the same)
Thanks again
Any idea on how to change the design to match the default installanywhere panels(e.g textfield doesn't look the same)
Thanks again
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)