Swing for http

Hello I want to ask how to know the difference on what I can do with Swing for http and Swing for desktop. I am programming an application in NetBeans for http and I don't know if all what I do work with http too or if there is some differences between desktop and http.
Someone can tell me please?
thanks

GonzaloP wrote:
Encephalopathic can you show me an example of this? I am begginer in java.Sure. But sorry if it's too long.
The first class, MyAppPanel.java, creates a JPanel on demand: if you call getMainPanel() on a MyAppPanel object, you'll get its JPanel. This JPanel doesn't do anything except draw some components on the screen for demonstration purposes:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;
public class MyAppPanel
  private static final String[] LABEL_STRINGS =
    "What is your Quest?", "What is your Favorite Color?", "What is the Capital of Assyria?",
    "What is the Air-Speed Velocity?"
  private static final String TITLE = "Bridge Questions";
  private JPanel mainPanel = new JPanel();
  public MyAppPanel()
    JPanel titlePanel = createTitlePanel(TITLE);
    JPanel dataPanel = createCenterPanel(LABEL_STRINGS);
    JPanel btnPanel = createButtonPanel();
    int eb = 10;
    mainPanel.setBorder(BorderFactory.createEmptyBorder(eb, eb, eb, eb));
    mainPanel.setBackground(Color.lightGray);
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
    mainPanel.add(titlePanel);
    mainPanel.add(createMySeparator(15));
    mainPanel.add(dataPanel);
    mainPanel.add(createMySeparator(15));
    mainPanel.add(btnPanel);
  private JPanel createMySeparator(int vs)
    JPanel mySeparator = new JPanel();
    mySeparator.setOpaque(false);
    mySeparator.setLayout(new BoxLayout(mySeparator, BoxLayout.PAGE_AXIS));
    mySeparator.add(Box.createVerticalStrut(vs));
    mySeparator.add(new JSeparator());
    mySeparator.add(Box.createVerticalStrut(vs));
    //mySeparator.setBorder(BorderFactory.createLineBorder(Color.blue));
    JPanel outerPanel = new JPanel(new BorderLayout());
    outerPanel.setOpaque(false);
    outerPanel.add(mySeparator);
    return outerPanel;
  private JPanel createButtonPanel()
    JPanel btnPanel = new JPanel(new GridLayout(1, 0, 20, 0));
    btnPanel.setOpaque(false);
    JButton saveBtn = new JButton("Save");
    JButton cancelBtn = new JButton("Cancel");
    btnPanel.add(saveBtn);
    btnPanel.add(cancelBtn);
    return btnPanel;
  private JPanel createCenterPanel(String[] labelStrings)
    JPanel westPanel = new JPanel(new GridLayout(0, 1, 0, 5));
    JPanel centrPanel = new JPanel(new GridLayout(0, 1, 0, 5));
    westPanel.setOpaque(false);
    centrPanel.setOpaque(false);
    for (int i = 0; i < labelStrings.length; i++)
      JLabel label = new JLabel(labelStrings);
westPanel.add(label);
centrPanel.add(new JTextField(12));
JPanel dataPanel = new JPanel();
dataPanel.setOpaque(false);
dataPanel.setLayout(new BorderLayout(10, 10));
dataPanel.add(westPanel, BorderLayout.WEST);
dataPanel.add(centrPanel, BorderLayout.CENTER);
return dataPanel;
private JPanel createTitlePanel(String text)
JPanel titlePanel = new JPanel();
titlePanel.setOpaque(false);
JLabel label = new JLabel(text);
label.setFont(label.getFont().deriveFont(Font.BOLD, 32));
titlePanel.add(label);
return titlePanel;
public JPanel getMainPanel()
return mainPanel;
Now if I want to use the produced JPanel in a stand-alone program, all I need to do is create a JFrame, place the JPanel in the JFrame's contentPane, pack and set the JFrame to visible, and I'm done. This next class, MyAppJFrame, does just that:
import javax.swing.JFrame;
import javax.swing.JPanel;
public class MyAppJFrame
  private static void createAndShowUI()
    MyAppPanel myappPanel = new MyAppPanel();  //create a myappPanel object
    JPanel panel = myappPanel.getMainPanel();  // get its JPanel
    JFrame frame = new JFrame("MyAppPanel"); // create the JFrame 
    frame.getContentPane().add(panel);   // and add the JPanel to the contentPane
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  public static void main(String[] args)
    java.awt.EventQueue.invokeLater(new Runnable()
      public void run()
        createAndShowUI();
}Now if I want to create a JApplet, I do the exact same thing, only this time place the JPanel into a JApplet's content frame, as this class MyAppApplet demonstrates:
import java.awt.Dimension;
import java.lang.reflect.InvocationTargetException;
import javax.swing.JApplet;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class MyAppJApplet extends JApplet
  @Override
  public void init()
    try
      SwingUtilities.invokeAndWait(new Runnable()
        public void run()
          MyAppPanel myAppPanel = new MyAppPanel();
          JPanel myPanel = myAppPanel.getMainPanel();  // get the JPanel from the MyAppPanel object
          getContentPane().add(myPanel); // place it in the JApplet just like we did for the JFrame
          setSize(new Dimension(myPanel.getPreferredSize()));
    catch (InterruptedException e)
      e.printStackTrace();
    catch (InvocationTargetException e)
      e.printStackTrace();

Similar Messages

  • Proxy authontication popup for Https is not getting displayed

    Hi,
    We have proxy server in java, and it should ask for the authentication, while using old versions of IE (IE6), opera we get proper proxy authentication prompt for Https as well as Http request.
    But with the new version of browser IE8, Firefox 2, ... 3 we are not getting the Proxy authentication prompt for the Https request only (for http its working fine)
    Actually the proxy server ask for authentication for the every first request only, but if the first request is Https then it fails with 407 error, as per the logic whenever we set response.setStatus("407"); response.setMessage("Proxy authentication required"); it should prompt for the proxy authentication and its working fine for old browsers and for Http request but its not working for new browser with Https request
    Could you please provide some information on how to achieve proxy authentications for Https and new versions browsers.
    Following are the code used for it
    /*ResponseProcessor.java*/
         public static Response createResponse(ScriptableConnection connection, String message) {
              Response response = new Response();
              Request request = connection.getRequest();
              response.setRequest(request);
              if (message.equals(SPConstants.TECHNICAL_ISSUES)) {
                   response.setContent(message.getBytes());
              if (message.equals(SPAuthorizationConstants.INVALID_CREDENTIALS)) {
                   //response.setVersion(request.getVersion());
                   response.setHeader("Proxy-Authenticate", "Basic");
                   response.setStatus("407");
                   response.setMessage("Proxy authentication required");
                   if (request.getHeader("Proxy-Authorization") != null) {
                        response.setContent(message.getBytes());
                   return response;
              return response;
    /*ConnectionHandler.java */
    public void run() {
    String authorizationStatus = RequestProcessor.checkUserPreRequiste(request,user,ticket,statusVisitor); //SP CODE
                        if(authorizationStatus.equals(SPAuthorizationConstants.USER_IS_AUHTORIZED)) { //SP CODE
                                 try {
                                      response = hc.fetchResponse(request);
                                      if (response.getRequest() != null)
                                           request = response.getRequest();
                                                 }catch........
                       } finally {
                   try {
                        if (_clientIn != null)
                             _clientIn.close();
                        if (_clientOut != null)
                             _clientOut.close();
                        if (_sock != null && !_sock.isClosed()) {
                             _sock.close();
                   } catch (IOException ioe) {
                        _logger.warning("Error closing client socket : " + ioe);
    .......Thanks in advance,
    Sachin

    Hi
    Follow the steps
    In your current view where you create your Popupwindow; create a model attribute name "popWin" of type IWDWindow;
    In code;after creating the popup window assign window object to the context element
    IWDWIndow window = WDComponentAPI.getWindowManager().createWindow( WindowInfo, true);
    wdContext.currentContextElement.setpopWin( window);
    At the Popup window view; create a model attribute name popWin of type IWDWindow and map it with the one that created before.
    set the code on btnaction
    IWDWindow popwin = (IWDWindow)wdContext.currentContextElement().getPopWin();
    popwin.destroyInstance();
    This will work
    Regards
      - Vinod
    Edited by: Vinod V on Mar 3, 2008 7:21 PM

  • Sharepoint warmup script for https sites

    we want to warm up https site which is based on sharepoint 2010.
    When we run some sample powershells it shows access forbidden error so we are not able to warm up https site.
    Its slow on first load so need some warmup script for https sites.
    sharepointer

    Just ensure that the service account that you use to trigger the Powershell scripts has access to IIS and SharePoint.  Most often, the SharePoint Farm account would be used for scheduling the warm up scripts on the WFE server.
    I trust that answers your question...
    Thanks
    C
    http://www.cjvandyk.com/blog

  • I have the new Air Port Extreeme model A1521 and I need to set up port forwarding for HTTP. HTTP is not on the list in the set up. Does anyone know if any of those choices work for HTTP?

    I am on a Windows 7 Ultimate PC and right now there is no Airport utility for setting up the new Apple Extreme so you have to do it on your iPad or iPhone. Does anyone know how to set up port forwarding for HTTP to get to DVR security cameras? There is nothing in the list that indicates HTTP port forwarding.

    Thanks for your reply Tesserax as I did figure this out on my own. It took a bit because all of the options are not clear what they are for like the previous Airport Extreme and Apple does not support or guarantee that port forwarding will work for you application nor did any of the Apple support persons I spoke too have any knowledge for this feature. You also have to fill in the public if you are viewing through someone else's Wi-Fi or on your cell phone carrier network. This new Airport Extreme is a bit different since you cannot use the Airport utility on a PC like the older model and if anyone else is reading this they should be aware that if you do not have an Apple computer, iPhone or iPad and I'm not sure if some of the other network enabled devices like iPod Touch that you must use that can do it, there is no Airport utility for the PC and you would be wasting your money or have to take it back and get another brand wireless router to use if you do not own any of the above mentioned Apple products.

  • Need suggestion for ISE distributed deployment model in two different data centers along with public certificate for HTTPS

    Hi Experts,
    I am bit confused about ISE distributed deployment model .
    I have two data centers one is DC & other one is as a DR I have  requirement of guest access service implementation using CWA and get public certificate for HTTPS to avoid certificate error on client devices :
    how do i deploy ISE persona for HA in this two data centers
    After reading cisco doc , understood that we can have two PAN ( Primary in DC  & Secondary in DR ) like wise for MnT (Monitoring will be as same as PAN ) however I can have 5 PSN running in secondary i.e. in DR ISE however I have confusion about HA for PSN .. since we have all PSN in secondary , it would not work for HA if it fails
    Can anybody suggest me the best deployment solution for this scenario ?
    Another doubt about public certificate :
     Public Certificate: The ISE domain must be a registered or part of a registered domain name on the Internet. for that I need Domain name being used from customer .
    Please do correct me if I am wrong about certificate understanding :
    since Guest will be the outside users , we can not use certificate from internal CA , we need to get the certificate from service provider and install the same in both the ISE servers
    Can anybody explain the procedure to opt the public certificate for HTTPS from service provider ? And how do i install it in both the ISE servers ?

    Hi there. Let me try answering your questions:
    PSN HA: The PSNs are not configured as "primary" or "secondary" inside your ISE deployment. They are just PSN nodes as far as ISE is concerned. Instead, inside your NADs (In your case WLCs) you can specify which PSN is primary, which one is secondary, etc. You can accomplish this by:
    1. Defining all PSN nodes as AAA radius servers inside the WLC
    2. Then under the SSID > AAA Servers Tab, you can list the AAA servers in the order that you prefer. As a result, the WLC will always use the first server listed until that server fails/gets reloaded, etc. 
    3. As a result, you can have one WLC or SSID prefer PSN server A (located in primary DC) while a second WLC or SSID prefer PSN server B (located in backup DC)
    Last but not the least, you could also place PSNs behind a load balancer and that way the traffic would be equally distributed between multiple PSNs. However, the PSN nodes must be Layer 2 adjacent, which is probably not the case if they are located in two different Data Centers
    Certificates: Yes, you would want to get a public certificate to service the guest portal. Getting a public/well known certificate would ensure that most devices out there would trust the CA that signed your ISE certificate. For instance, VeriSign, GoDaddy, Entrust are some of the ones out there that would work just fine. On the other hand, if you use a certificate that was signed by your internal CA, then things would be fine for your internal endpoints that trust your internal CA but for any outsiders (Guests, contractors, etc) that do not trust and do not know who your internal CA is would get a certificate error when being redirected to the ISE guest portal. This in general is only a "cosmetic" issue and if the users click "continue" and add your CA as a trusted authority, the guest page would load and the session would work. However, most users out there would not feel safe to proceed and you will most likely get a lot of calls to your helpdesk :)
    I hope this helps!
    Thank you for rating helpful posts!

  • How do i get that bar to appear on the screen for http and web pages?

    How do i get that bar to appear on top of the screen for http and web pages?

    Yes im using safari version  5.1.2 (6534.52.7)  I have tried clicking show toolbar  from the view menu but i still can't see it.  It's the bar where you type in a website link or http:// that I can find - any other suggestions much appreciated

  • Sender Agreements for HTTPS

    Hi
    I am aware that there that there is no Sender Agreement necessary for sender Http scenario, maybe a silly question but why in that case is there a Sender option on the HTTP communication channel ?. Also for HTTPS if there is no sender agreement (hence no Communication Channel) then where can HTTPS be assigned as the Security Level on the channel, i.e. the "Security Check for Incoming Messages option".
    Thanks
    Damien

    Hi!
    According to my knowledge in XI there the HTTP Sender service is in disable and eventhough u can create in XI. but now in Latest version like PI 7.1 the service is enable
    In mostly in some real time projects there are some requirements like they need some security purposes in that cases mostly they need a Sender agreement mandatory for security purpose.
    Inorder to satisfy these requirements they are configuring HTTP sender and hence Sender agreement and but they are selecting as HTTPS protocol and while selecting HTTPS protocol kindly note one point that your network Firewall settings needs to be in open and they needs to all the flow of messages.
    I hope now you are free from confusion.
    Regards:
    Amar Srinivas Eli

  • Please shed some light on Chunked Transfer Coding for HTTP 1.1?

    I am writing a HTTP proxy in Java, but I have a problem. I am writing a HTTP 1.0 proxy. As you probably know, HTTP 1.0 determines the length of the message body using Content-Length and HTTP 1.1 server are supposed to send a Content-Length header to HTTP 1.0 clients. However, several sites like Myspace is very buggy and do not do this. Could someone explain what the Chunked Transfer Coding is for HTTP 1.1? I read the documentation here http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6 but it's all greek to me :(. Can anybody give me code/hints on how to deal with this?
    Thanks in advance.

    Hi, Toshi:
    Most of these chat boards have become quite boring. Troubleshooting OSPF LSA problems is old news. But I do pop my head in every now and then. Also, there are so many other companies out there doing exciting things in the data center. You have Dell, Brocade, Arista, Juniper, etc. So one runs the risk of developing a myopic view of the world of IT by lingering around this board for too long.
    If you want to use the new B22 FEX for the HP c7000 blade chassis, you certainly can. That means the Nexus will receive the FCoE traffic and leverage its FCF functionality; either separate the Ethernet and FC traffic there, or create a VE-port instantiation with another FCF for multihop deployments. Good luck fighting the SAN team with that one! Another aspect of using the HP B22 is the fact that the FEX is largely plug and play, so you dont have to manage the Flex Fabric switches.
    HTH

  • Sender communication channel for  HTTP and IDOC

    Why the sender communication channel is not necessary for HTTP and IDOC

    Hi,
    Because they lie on ABAP stack ie on Integration Engine...so that they can process directly but other adapter lies on Adapter engine.
    Regards
    Hemant

  • Remove namespace alias for HTTP receiver adapter

    hello all,
    I have a scenario, IDOC->XML (HTTPS). Standard output of PI has ns0: as prefix for each xml tag (ns0 alias for namespace)
    I want to remove the namespace alias while preserving the namespace in the output. So removing namespace reference in external definition is not a option.
    Is there any way to use XMLAnonymizerBean for HTTP receiver adapter? What are other alternatives (java mapping)?
    Thanks,
    sachin

    Thanks stefan, prateek.
    Prateek: I checked this blog earlier. It talks about inbound processing. My scenario is outbound HTTP and I am not sure how I can use specific adapter service as mentioned in blog in outbound case as other scenarios are using standards adapter_plain service.
    Stefan: I will try this approach.
    regards,
    sachin

  • Dynamic URL for HTTP receiver adapter

    Hi all,
    when the XI send the http request to the target system, the format maybe like this:
    header + body the body is including: Prolog, payload and Epilog
    here is about the target system have a 'input' parameter(maybe string type)
    is it possible to pass the 'head + body' these value(or maybe the whole http request message) into input
    i mean is it possible to set the dynamic URL for http receiver adapter like this:
    http://host:port/path?input=<the header and body>
    i have searched the blog Dynamic Configuration of Some Communication Channel Parameters using Message Mapping
    Link:[/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping]
    and the similar threads in the forum
    please give me some advice
    thanks in advance

    When a HTTP server requests the whole message as URL parameters, then I assume that the server also requests an HTTP GET, which is not supported by XI.
    Could you check this?
    Regards
    Stefan

  • Do transport acknowledgement work for HTTP ?

    hi all,
    I'm posting an HTTP in a BPM scenario.I've put mode as transport in send step.
    However in SXMB_moni its showing,ack not possible.
    I've searched and it seems ack is possible for HTTP.
    can anyone tell why i am getting the error?

    When you say you use the Transport ACK functionality of the BPM-Send step what you do is you ask for a ack status from the adapter Engine....but according to the functionality both IDOC and HTTP adapter do not use AE....so when you demand for an ACK for your HTTP send step you wont get it....why? the message does not pass through AE (can you see/ monitor it in RWB?).....So Transport Ack for send step in HTTP communication wont help you..
    I just want to know that HTTP was posted successfully.
    Is there a way to achieve that usign BPM (transport ack)?
    Make the Send step in your BPM synchronous and put it in a block.....define an exception branch and put the logic that you want to implement if the send fails.....if successful then put a COntrol Step (Cancel Process) after the Sync Send.....
    If you say to me implement the Transport Ack...then it will be my last option.....I am implementing the above method of checking success/ failure in my project (the adapter is SOAP)......
    Regards,
    Abhishek.

  • Multiple HTTP Servers, 1 for HTTP and other for HTTPS

    I am trying to install 9ias 1.0.2.2.2 on 2 machines both running solaris. 1st machine hosts the database (8.1.7.4) and the other hosts the App server (9ias), what i am tryin to achive is have 2 listeneres. One for HTTP traffic and other for HTTPS traffic. Have anyone configured this and could shed some light and enlighten me.
    With all the notes i have read i have understood that i need to basically install 2 instance of Apache in 2 different Oracle Homes. but my question is how can i just have one portal repository. or rather i should say if somebody could guide me from installing the 2 instance of Apache.
    Thanks
    Mir

    You left out Twixl.
    Bob

  • When i send a test message throw the RWB for Http receiver adapter it is giving the error "Error in processing caused by: com.sap.aii.adapter.http.api.HttpAdapterException: ERROR_SOCKET_TIMEOUT, Read timed out"

    when i send a test message throw the RWB for Http receiver adapter it is giving the error "Error in processing caused by: com.sap.aii.adapter.http.api.HttpAdapterException: ERROR_SOCKET_TIMEOUT, Read timed out"

    Hi, Michal
    I have read your Weblog. It makes sense to me. Thanks a lot for your help! However, I still have some questions and listed them as following. Could you please help to answer them?
    <b>Q1:</b> I am new to SAP-XI. So I have no idea about TCODE-SXMB_ADM. Could you introduce more details about it?
    <b>Q2:</b> The XI system I am using is running on SAP-ICC's machine. The tools I can use are:
    <b>1.</b>Builder for Integration Repository
    <b>2.</b>Builder for Integration Configuration
    <b>3.</b>System Landscape Directory
    <b>4.</b>Runtime Workbench
    <b>5.</b>Administration System (for Repository, Directory, Runtime)
    Please note that I do not have a complete control on this SAP-XI. Do you think whether or not I can set the timeout parameter by following the instructions provided in your Weblog?
    For more details about my SAP-XI, please access the following Web page:
    http://iccxi.sap.com:58000/rep/support/admin/index.html
    <b>Q3:</b> The following messages are extracted from the SAP-XI. Wish they are hepful to solving my problem.
    2006-06-19 05:12:16 Success The message was successfully received by the messaging system. Profile: XI URL: http://iccxi.sap.com:58000/MessagingSystem/receive/AFW/XI
    2006-06-19 05:12:16 Success Using connection AFW. Trying to put the message into the request queue.
    2006-06-19 05:12:16 Success Message successfully put into the queue.
    2006-06-19 05:12:16 Success The message was successfully retrieved from the request queue.
    2006-06-19 05:12:16 Success The message status set to DLNG.
    2006-06-19 05:12:16 Success Delivering to channel: ValidationRequestHandlerServiceChannel
    2006-06-19 05:12:16 Success SOAP: request message entering the adapter
    2006-06-19 05:12:37 Success SOAP: call failed
    2006-06-19 05:12:37 Error SOAP: error occured: java.net.ConnectException: Connection timed out: connect
    2006-06-19 05:12:37 Error Exception caught by adapter framework: Connection timed out: connect
    Thanks
    Menghua Li

  • Steps for  http receiver adapter communication channel

    Hi
    can you please specify steps for http receiver communication channel?
    thanks
    Prasad

    Hi Prasad,
    Here's the documentation for configuring the http adapter in the communication channel(rcve):-
    http://help.sap.com/saphelp_nw04/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/frameset.htm
    Regards,
    Sushumna

Maybe you are looking for