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: Need help in writing custom code panel
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 09, 2008
09:47 AM
Need help in writing custom code panel
Hi,
im trying to add a custom code panel to my installer... i was following the manual.,.. wrote a java class extending customcodepanel and implemented setUI method.. created a jar using jar -cvfM jarname.jar om/somename/myPanel.class
and added it to customcode panel in pre install tasks.. but i dont see the panel that was added.. i added swinglayout.jar in dependent jars ...
i dont know where im going wrong.. hope someone here in this community will help me on this problem
im trying to add a custom code panel to my installer... i was following the manual.,.. wrote a java class extending customcodepanel and implemented setUI method.. created a jar using jar -cvfM jarname.jar om/somename/myPanel.class
and added it to customcode panel in pre install tasks.. but i dont see the panel that was added.. i added swinglayout.jar in dependent jars ...
i dont know where im going wrong.. hope someone here in this community will help me on this problem
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2008
10:29 AM
It sounds like you are doing the right steps. Make sure the setupUI method returns true. What do you see in the debug output when running the installer?
Can you post your project, or a sample project that replicates the problem, and your jarfile containing your custom panel? You may need to post your custom panel code too.
Can you post your project, or a sample project that replicates the problem, and your jarfile containing your custom panel? You may need to post your custom panel code too.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2008
12:26 PM
/*
* AppServerSettings.java
*
* Created on July 9, 2008, 10:21 PM
*/
package com.zerog.ia.customcode.panel;
import com.zerog.ia.api.pub.CustomCodePanel;
import com.zerog.ia.api.pub.CustomCodePanelProxy;
import javax.swing.*;
import java.net.InetAddress;
/**
*
* @author mprabhushankar
*/
public class AppServerSettings extends CustomCodePanel {
public static CustomCodePanelProxy cc;
String IP_Address=null;
/** Creates new form AppServerSettings */
public AppServerSettings() {
}
public String getLocalIP()
{ try
{
InetAddress IAddress=InetAddress.getLocalHost();
IP_Address=IAddress.getHostAddress();
}catch(Exception e){System.out.println(e.getMessage());}
return IP_Address;
}
//
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
setBackground(new java.awt.Color(255, 255, 255));
jLabel1.setText("JBoss");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(66, 66, 66)
.add(jLabel1)
.add(18, 18, 18)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 154, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(135, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(37, 37, 37)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel1))
.addContainerGap(244, Short.MAX_VALUE))
);
}//
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
@Override
public boolean setupUI(CustomCodePanelProxy arg0) {
initComponents();
jTextField1.setText(getLocalIP());
return true;
}
}
* AppServerSettings.java
*
* Created on July 9, 2008, 10:21 PM
*/
package com.zerog.ia.customcode.panel;
import com.zerog.ia.api.pub.CustomCodePanel;
import com.zerog.ia.api.pub.CustomCodePanelProxy;
import javax.swing.*;
import java.net.InetAddress;
/**
*
* @author mprabhushankar
*/
public class AppServerSettings extends CustomCodePanel {
public static CustomCodePanelProxy cc;
String IP_Address=null;
/** Creates new form AppServerSettings */
public AppServerSettings() {
}
public String getLocalIP()
{ try
{
InetAddress IAddress=InetAddress.getLocalHost();
IP_Address=IAddress.getHostAddress();
}catch(Exception e){System.out.println(e.getMessage());}
return IP_Address;
}
//
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
setBackground(new java.awt.Color(255, 255, 255));
jLabel1.setText("JBoss");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(66, 66, 66)
.add(jLabel1)
.add(18, 18, 18)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 154, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(135, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(37, 37, 37)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel1))
.addContainerGap(244, Short.MAX_VALUE))
);
}//
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
@Override
public boolean setupUI(CustomCodePanelProxy arg0) {
initComponents();
jTextField1.setText(getLocalIP());
return true;
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2008
02:39 PM
can u tell me how to debug the installer... is that log.xml file the only way to do it
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 10, 2008
11:00 AM
The custom code works fine. The problem would be in your project and how you are calling it. Make sure you are doing a Panel:CustomCode action and not just a CustomCode action in your pre-install.
For debug output, it is one of the top docs in the KB. If you are on Windows, hold down the CTRL button while the installer is extracting.
For debug output, it is one of the top docs in the KB. If you are on Windows, hold down the CTRL button while the installer is extracting.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 11, 2008
12:42 AM
Thanks .. i noticed it.. it works fine now... i added some more panels too..
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)