import java.awt.Color;
import java.awt.EventQueue;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextArea;
import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import com.jgoodies.forms.factories.DefaultComponentFactory;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class MainApp {
private JFrame frmIntegrationServiceApi;
private JTextField textField;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainApp window = new MainApp();
window.frmIntegrationServiceApi.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public MainApp() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmIntegrationServiceApi = new JFrame();
frmIntegrationServiceApi.setTitle("Integration Services API Test");
frmIntegrationServiceApi.setBounds(100, 100, 900, 590);
frmIntegrationServiceApi.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmIntegrationServiceApi.getContentPane().setLayout(null);
JLabel lblNewLabel = new JLabel("IS Host");
lblNewLabel.setBounds(20, 11, 42, 14);
frmIntegrationServiceApi.getContentPane().add(lblNewLabel);
textField = new JTextField();
textField.setBounds(82, 8, 238, 20);
frmIntegrationServiceApi.getContentPane().add(textField);
textField.setColumns(10);
JLabel lblInterface = new JLabel("Interface");
lblInterface.setBounds(20, 42, 56, 14);
frmIntegrationServiceApi.getContentPane().add(lblInterface);
final JComboBox comboBox = new JComboBox();
comboBox.setModel(new DefaultComboBoxModel(new String[] {"Select Interface", "IAgentManagment", "IContactManagement", "ISessionManagment"}));
comboBox.setBounds(82, 39, 238, 20);
frmIntegrationServiceApi.getContentPane().add(comboBox);
class MyItemListener implements ItemListener
{
@Override
public void itemStateChanged(ItemEvent arg0) {
if(comboBox.getSelectedIndex() == 1)
{
IAgent ia = new IAgent();
ia.setBounds(20, 70, 300, 425);
frmIntegrationServiceApi.getContentPane().add(ia);
}
}
}
MyItemListener actionListener = new MyItemListener();
comboBox.addItemListener(actionListener);
JLabel lblGeneratedUrl = new JLabel("Generated URL to Post to Integration Services");
lblGeneratedUrl.setBounds(389, 11, 288, 14);
frmIntegrationServiceApi.getContentPane().add(lblGeneratedUrl);
JTextArea textArea = new JTextArea();
textArea.setBounds(389, 25, 485, 46);
frmIntegrationServiceApi.getContentPane().add(textArea);
JLabel lblNewLabel_1 = new JLabel("Response from API in HTML");
lblNewLabel_1.setBounds(389, 82, 138, 14);
frmIntegrationServiceApi.getContentPane().add(lblNewLabel_1);
JTextArea textArea_1 = new JTextArea();
textArea_1.setBounds(389, 103, 485, 257);
frmIntegrationServiceApi.getContentPane().add(textArea_1);
JLabel lblNewLabel_2 = new JLabel("Response from API in Text");
lblNewLabel_2.setBounds(389, 371, 138, 14);
frmIntegrationServiceApi.getContentPane().add(lblNewLabel_2);
JTextArea textArea_2 = new JTextArea();
textArea_2.setBounds(389, 393, 485, 148);
frmIntegrationServiceApi.getContentPane().add(textArea_2);
JButton btnCreateUrl = new JButton("Create URL");
btnCreateUrl.setBounds(20, 518, 112, 23);
frmIntegrationServiceApi.getContentPane().add(btnCreateUrl);
JButton btnPost = new JButton("Post");
btnPost.setBounds(142, 518, 89, 23);
frmIntegrationServiceApi.getContentPane().add(btnPost);
final JPanel panel = new JPanel();
panel.setBounds(20, 67, 300, 425);
frmIntegrationServiceApi.getContentPane().add(panel);
}
}