cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
prabubiginstall
Level 5

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
Labels (1)
0 Kudos
(5) Replies
purcellk24
Level 7

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.
0 Kudos
prabubiginstall
Level 5

/*
* 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;
}



}
0 Kudos
prabubiginstall
Level 5

can u tell me how to debug the installer... is that log.xml file the only way to do it
0 Kudos
purcellk24
Level 7

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.
0 Kudos
prabubiginstall
Level 5

Thanks .. i noticed it.. it works fine now... i added some more panels too..
0 Kudos