DrawImage on NetBeans-created jFrame

Hi, I've built the basics of a GUI with swing in Netbeans 6.1. I'd like to draw an image onto an existing jFrame, but I'm having some difficulty. I have a simple class to draw part of the image:
public class LoadImageApp extends Component {
    public BufferedImage img;
    public LoadImageApp() {
       try {
           img = ImageIO.read(new File("D:/image.jpg"));
       } catch (IOException e) {System.out.println("Nothing");}
    @Override
    public void paint(Graphics g) {
        g.drawImage(img, 0, 0, 100, 100, 0, 0, 100, 100, null);
    @Override
    public Dimension getPreferredSize() {
        if (img == null) {
            return new Dimension(100,100);
        } else {
            return new Dimension(200,200);
}Then I am attempting to draw/display the image when a button is clicked:
private void loadImageActionPerformed(java.awt.event.ActionEvent evt) {
    final JFrame f = new JFrame("Load Image Sample");
    f.addWindowListener(new WindowAdapter(){
        @Override
        public void windowClosing(WindowEvent e) {
            f.setVisible(false);
    f.add(new LoadImageApp());
    f.pack();
    f.setVisible(true);
    jFrame1.add(new LoadImageApp());
    jFrame1.pack();
    jFrame1.setVisible(true);
}For frame "f" - everything works as expected. Frame is displayed, image is drawn, and window is sized properly.
For frame "jFrame1" (created with swing/netbeans) - Frame is displayed, but image is not drawn and window is not sized properly.
Why is this?
I have read something about overriding update for the frame, but I don't know how to do this for the netbeans code, or if it is even the correct thing to do here. So any help is greatly appreciated!
Edited by: gtg811a on Aug 5, 2008 11:10 PM

I appreciate the initial effort.
Rodney_McKay wrote:
You have 2 options:
*1*. Don't use NetBeans.
*2*. Post your question in a NetBeans forum.Believe it or not, this was not helpful. Actually, you might even say it was pompous. Not everyone has been doing this for a long time, so no, you didn't give me the information to answer my question (well maybe in the sense that directing me to www.google.com would be the information to answer it). Seems to me that in a Java graphics forum there might be one or two people who use NetBeans for GUI building. And by posting some snide remark rather than helpful information, you basically cut the thread off from useful input. I'll read the rules for posting to a forum if you'll be just a little less jaded about answering questions.

Similar Messages

  • Netbeans: creating a jar including jar libraries

    Hi everyone,
    I am trying to create a jar of my netbeans project which includes some other jars as libraries.
    The problem is that it compiles ok and creates the jar but unfortunately it does not include in the project .jar the libraries needed for the execution.
    Therefore when I run the program it complains with a java.lang.NoClassDefFoundError.
    Anyone can advise on how I can solve this?
    Cheers

    Read the README.TXT file that NetBeans creates in your dist folder. And please be informed that this is a forum for problems related to the Java lanuage and standard API, not for an IDE.
    There are IDE forums on nabble.com and java-forums.org
    db

  • Best way to allow user to create JFrame

    Hi,
    I'm working on a part of an application that needs to allow a user to create some type of "Frame". I'll give an example: when you use an IDE an create a JFrame you can drag object to the frame until your happy with it. I you like to do something similar, obviously much more simple than an IDE.
    I have been looking at some libraries, specially XML - SWING, but not sure if its the best solution. I don't want to reinvent the wheel. So anything that could help, is more than welcome.
    thanks.

    I may not have explained myself well here.
    I want to only allow the operator to select sequences that are set up to be able to run independently. I don't want the callbacks and initialization sequences to show up in the list the operator can choose from.
    The way I figured out how to do it is a little tricky, and I think I may have found a bug.
    This is what I did:
    For the sequences I do not want to be selectable, I setPropFlags_Hidden to true. (Sequence Properties...Advanced...Flags, check the box).
    This immediately hides the sequence. In order to see all hidden sequences to edit them, set Configure->Station Options...Preferences->Show Hidden Properties.
    I wanted to set this up automatically for the sequence file, so I added a SequenceFileLoad callback to set ThisContext.RunState.Engine.StationOptions.ShowHiddenProperties = False, and a SequenceFileUnload callback to set it back to true.
    The bug I think I found:
    This solution works when I open the sequence file in the editor, but not when I use the simple operator interface. The simple operator interface will show the hidden sequences, but only the unhidden sequences show up in the RUN_SEQUENCE control. If I make sure the station is configured not to show hidden properties BEFORE I run the simple operator interface, then the hidden sequences are indeed hidden in the Sequences list (except, because I hid MainSequence, the first list entry shows up blank until I select one of the unhidden sequences).
    (see also
    http://forums.ni.com/t5/NI-TestStand/Ignore-a-Sequence-in-a-SequenceCall/m-p/1754984/highlight/false...)

  • How to create Jframe?

    How to create a basic programme that shows JFrame?
    Please guide me.

    Similarly,
    public class ThePanel extends JPanel implements <insert list of listeners here>
    }There are any number of things wrong with having a frame/panel subclass defined this way.
    1. Often coders with any number of disparate buttons make their
    frame or panel listener to them all:
    public class ThePanel extends JPanel implements ActionListenerThen the actionPerformed method is a laundry list of if/then/elseifs. Ugh.
    That's the perfect situation for specific action objects listening to specific controls.
    2. Exposing implementation details: the fact that the panel is listening
    to list selection is not part of the API for the panel, it's an implementation
    detail, yet that's not what this reads as:
    public class ThePanel extends JPanel implements ListSelectionListenerWhat's to stop other code from doing the following?
    unrelatedList.addListSelectionListener(thePanel); //woops, thePanel wasn't meant to listen to *that* list.It's surprising what cruft people won't tolerate in other areas of code are
    happy to commit in Swing code.
    Message was edited by:
    DrLaszloJamf

  • NetBeans Create new Record to Database, How to retrieve it?

    Hi
    I am new to java and using NetBeans and JBoss to develop a new web application now.
    I created a new "ComModule" record to "ComModule" table in database inside my servlet while clicking Add button on my web page.
    The codes are:
    ComModuleFacadeRemote comModuleFacadeRemote = this.lookupComModuleFacade();
    ComModule cm = new ComModule();
    cm.setSerialNumber(serialNo);
    cm.setMacAddress(MACAddress);
    comModuleFacadeRemote.create(cm);
    As in ComModule class, I have set the ComModule ID as sequence and primary key. So this code will add a new reocord by increasing the sequence key automatically.
    What i need to do now is to retrieve the new added record in "ComModule" table and pass it as an Object for other uses.
    e.g. I can do like this:
    ComModule cmObj = comModuleFacadeRemote.getComModuleByID(id);
    BUT the problem now is I don't know the ID of the new added record. How can I retrieve it?
    In ComModuleFacade(), the common method are CREATE, DESTROY, EDIT, FIND, FINDALL. Is there a method that I can directly retrieve a new inserted record??
    Thanks a lot for any of your help...
    Edited by: OhLei on Mar 19, 2008 12:24 AM

    Hi,
      public Long create(name,surname) throws
                SomeException{
            Person person=null;
                try{
                    person=new Person(name,surname);
                    em.persist(object);
                }catch (Exception ex){
                     throw new EJBException("create: " + ex.getMessage());
            return person.getId();  //here it will return your id
        }Person is an entity class with fields id, name, surname.
    Good Luck.

  • Referencing on several dynamically created JFrames

    Hi,
    I've developed an application for managing tour datas of bike computers.
    The loaded tours will shown in a JTable as rows.
    With double click on a row, the tour editor will opend (another JFrame class). The user can change some values ot the bike tour.
    The user has also the possibility to open several instance of the tour edit class - for different tours in the tour table.
    My problem is to find out, if the tour edit object is already created for a certain tour entry in the tour table. Instead of creating a new tour edit object, the already opened tour edit object should get the focus.
    How can I manage this? My first idea is, to store all open tour edit object in a static hashmap (w/ unique key) inside the tour edit class.
    My second problem is, to transfer the changed bike tour object (w/ the bike trackpoints) to the calling object with list of tours. I've a boolean flag to show, that the tour is changed an i've a getTour() methode to pull the actual tour from the tour edit object.
    But, how should I say it to the calling app before the tour edit object is disposed.
    Thanx for ideas,
    Hans

    I have done something very similiar to what you are doing; however, without seeing exactly what is triggering your GUI to add text to the text area's it is hard to give you an exact answer.
    Just keep in mind that on all events you should be able to get the source component, which would then let you call the getName method of that component. So if a MouseEvent is the trigger for adding text you can get the name like this:
    String compName = ((JComponent) mouseEvent.getSource()).getName()
    (assuming you set the name of the component when you instantiated it)
    (I have some subclasses that are detected at runtime via reflection, each subclass gets a JCheckBox, there can be 0 or more of these subclasses. I used the getSource/setName/getName methods to determine which checkbox was clicked on even though I don't have a named reference to each one)

  • NetBeans - Creating TreeNodes in design view

    Not 100% sure if this is the right spot...
    I've always enjoyed netbeans for creating Java applications not only for it's syntax highlighting, and auto-completion, but for it's design view. It's a lovely area where you can design the GUI instead of coding it, which makes the process of creating applications very easy.
    My issue is that I need to create a tree. So I click on the Tree Swing component and place it in the page. Works fine, but now I need to add a tree model to it so that it actually works for how I want it to work. I've been told there's a treenode component somewhere (the GUI also hints toward it), but I can't find that. Can someone inform me where it is?

    smarttart62 wrote:
    Not 100% sure if this is the right spot...Nope. It's for questions about Java programming. If you want to ask questions about how to use Netbeans then a Netbeans forum would be better. Here's one that I found:
    http://www.netbeans.org/community/lists/top.html

  • DrawImage into JPanel creates an imaginary panel??

    Hi there,
    I'm new (to here and to Java) but I'm having this problem. I'm trying to get 26 image files all layered on top of one another in a JPanel, and I've managed to get them to show up, but they come up in only a small part of my JPanel? If I change the alignment it just changes their alignment within this small rectangle? I've looked over and over my code, but can't find anything obviously wrong, can anyone else?!
    This is the class MyImages which loads and displays the images:
    package mmv2;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.JPanel;
    @author bryonywalker
    public class MyImages2 extends JPanel{
             private MyClip mc1;
             private String[] imageFiles = {
                 "mmv2/classical1.png",
                 "mmv2/classical2.png",
                 "mmv2/classical3.png",
                 "mmv2/dance1.png",
                 "mmv2/dance2.png",
                 "mmv2/dance3.png",
                 "mmv2/dance4.png",
                 "mmv2/jazz1.png",
                 "mmv2/jazz2.png",
                 "mmv2/jazz3.png",
                 "mmv2/jazz4.png",
                 "mmv2/latin1.png",
                 "mmv2/latin2.png",
                 "mmv2/latin3.png",
                 "mmv2/pop1.png",
                 "mmv2/pop2.png",
                 "mmv2/pop3.png",
                 "mmv2/pop4.png",
                 "mmv2/reggae1.png",
                 "mmv2/reggae2.png",
                 "mmv2/reggae3.png",
                 "mmv2/reggae4.png",
                 "mmv2/rock1.png",
                 "mmv2/rock2.png",
                 "mmv2/rock3.png",
                 "mmv2/rock4.png"
             private BufferedImage[] img = new BufferedImage[imageFiles.length];
        private static ClassLoader cL;
            public MyImages2(){
                initComponents();
                readImages();
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 270, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(0, 300, Short.MAX_VALUE)
        }// </editor-fold>                       
        // Variables declaration - do not modify                    
        // End of variables declaration                  
            public void readImages() {
            URL url;
            try {
                cL = this.getClass().getClassLoader();
                for (int i = 0; i < imageFiles.length; i++) {
                    url = cL.getResource(imageFiles);
    img[i] = ImageIO.read(url);
    } catch (IOException e) {
    System.out.println("IO Exception");
    mc1.tidyUpAndExit(1);
    @Override
    protected void paintComponent(Graphics g) {
    System.out.println ("beginning of PC");
    super.paintComponent(g);
    if(img != null)
    for (int i = 0; i < imageFiles.length; i++) {
    System.out.println("before" +img[i]);+
    + g.drawImage(img[i], 0, 0, this);+
    + System.out.println("after"+ img[i]);
    else{
    System.out.println("img=null!!");
    }And the part of my frame class which calls it:public class MainFrame extends javax.swing.JFrame {
    private MyClip mc;
    private MyImages2 mi;
    public MainFrame() {
    initComponents();
    mi = new MyImages2();
    jPanel3.add(mi);
    mc = new MyClip();
    }Very grateful for any help/hints. It is currently looking like this:  [Current GUI|http://i46.tinypic.com/m9ob9g.jpg]  where the orange panel on the right is "jPanel3" - and those photos should be filling up this panel!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    This line g.drawImage(img, 0, 0, this);will draw the images at their true pixel size. If you want the images to be scaled to fit the panel, you will need to use a form of drawImage that takes a width and height as a parameter, probably drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
    db
    edit Unless many of the images have considerable transparent areas, it doesn't seem to make sense to draw them all at the same point though. What exactly are you trying to achieve?
    Edited by: DarrylBurke

  • How to setExtendedState for NetBeans IDE JFrame

    Hello.
    I seem to have a problem with using the visual editor to set extended state for my jframe in NetBeans IDE.
    I would like to make max out the screen, is there a way or a work around in this case?
    Thank you very much.

    I would like to make max out the screen, is there a
    way or a work around in this case?Did you mean maximizing the JFrame ? Then this will help
    setExtendedState(JFrame.MAXIMIZED_BOTH);Good luck! Happy New Year

  • Netbeans creating wsdl file having message with more than one part...

    Hi,
    I am using netbeans 6.0.1. I made an xml schema, then I wanted to make an wsdl that uses that schema.
    I wanted to put in a message more parts(3), and it would not let me. Then, i made the message with just one part, and added the other parts afterwards.
    But now, when I try to make a web service from that wsdl, it says that there is no service in the specified wsdl file.
    And if i let that message with just one part, it will make the Web Service.
    here is the xml schema and the wsdl file:
    XML Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/Abruf38"
    xmlns:tns="http://xml.netbeans.org/schema/Abruf38"
    elementFormDefault="qualified">
    <xsd:complexType name="FormRequest">
    <xsd:sequence>
    <xsd:element name="newRequest" type="xsd:boolean"/>
    <xsd:element name="requestNumber" type="xsd:int"/>
    <xsd:element name="vehicleClass" type="xsd:string"/>
    <xsd:element name="vehiclesNumber" type="xsd:int"/>
    <xsd:element name="prefferedType" type="xsd:string"/>
    <xsd:element name="kombi" type="xsd:boolean"/>
    <xsd:element name="usageMission" type="xsd:boolean"/>
    <xsd:element name="usageEducation" type="xsd:boolean"/>
    <xsd:element name="usageGeneral" type="xsd:boolean"/>
    <xsd:element name="usageOthers" type="xsd:string"/>
    <xsd:element name="eqVehicle" type="xsd:boolean"/>
    <xsd:element name="eqDangerous" type="xsd:boolean"/>
    <xsd:element name="eqPlaneSpriegel" type="xsd:boolean"/>
    <xsd:element name="eqBegrstll" type="xsd:boolean"/>
    <xsd:element name="eqMSitzBTruck" type="xsd:boolean"/>
    <xsd:element name="eqVerzurrAusst" type="xsd:boolean"/>
    <xsd:element name="eqOthers" type="xsd:string"/>
    <xsd:element name="bringService" type="xsd:boolean"/>
    <xsd:element name="holService" type="xsd:boolean"/>
    <xsd:element name="chauffService" type="xsd:boolean"/>
    <xsd:element name="otherService1" type="xsd:string"/>
    <xsd:element name="otherService1Chk" type="xsd:boolean"/>
    <xsd:element name="otherService2" type="xsd:string"/>
    <xsd:element name="otherService2Chk" type="xsd:boolean"/>
    <xsd:element name="otherService3" type="xsd:string"/>
    <xsd:element name="otherService3Chk" type="xsd:boolean"/>
    <xsd:element name="activity" type="xsd:string"/>
    <xsd:element name="costPayer" type="xsd:string"/>
    <xsd:element name="costCenter" type="xsd:string"/>
    <xsd:element name="vehicleCost" type="xsd:float"/>
    <xsd:element name="chauffServiceCost" type="xsd:float"/>
    <xsd:element name="holBringServiceCost" type="xsd:float"/>
    <xsd:element name="totalCost" type="xsd:float"/>
    <xsd:element name="tripPurpose" type="xsd:string"/>
    <xsd:element name="fixTermin" type="xsd:boolean"/>
    <xsd:element name="justificationFix" type="xsd:string"/>
    <xsd:element name="requestID" type="xsd:string"/>
    <xsd:element name="rentalPeriod" type="tns:RentalPeriod"/>
    <xsd:element name="carPool" type="tns:CarPool"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="CarPool">
    <xsd:sequence>
    <xsd:element name="poolID" type="xsd:string"/>
    <xsd:element name="poolName" type="xsd:string"/>
    <xsd:element name="orgNumber" type="xsd:string"/>
    <xsd:element name="vehicle" maxOccurs="unbounded" type="tns:Vehicle"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="RentalPeriod">
    <xsd:sequence>
    <xsd:element name="rentalPeriodID" type="xsd:string"/>
    <xsd:element name="startDate" type="xsd:date"/>
    <xsd:element name="endDate" type="xsd:date"/>
    <xsd:element name="startTime" type="xsd:time"/>
    <xsd:element name="endTime" type="xsd:time"/>
    <xsd:element name="startLocation" type="xsd:string"/>
    <xsd:element name="endLocation" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Vehicle">
    <xsd:sequence>
    <xsd:element name="vehicleID" type="xsd:string"/>
    <xsd:element name="vehicleClass" type="xsd:string"/>
    <xsd:element name="vehicleRegisterNo" type="xsd:int"/>
    <xsd:element name="vehicleType" type="xsd:string"/>
    <xsd:element name="seatsNumber" type="xsd:int"/>
    <xsd:element name="cost" type="xsd:float"/>
    <xsd:element name="available" type="xsd:boolean"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Contact">
    <xsd:sequence>
    <xsd:element name="contactID" type="xsd:string"/>
    <xsd:element name="contactName" type="xsd:string"/>
    <xsd:element name="telNumber" type="xsd:int"/>
    <xsd:element name="faxNumber" type="xsd:int"/>
    <xsd:element name="loNo" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Person">
    <xsd:sequence>
    <xsd:element name="personID"/>
    <xsd:element name="department" type="xsd:string"/>
    <xsd:element name="serviceNumber" type="xsd:int"/>
    <xsd:element name="contact" type="tns:Contact"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Department">
    <xsd:sequence>
    <xsd:element name="departmentID" type="xsd:string"/>
    <xsd:element name="fundsDepartment" type="xsd:string"/>
    <xsd:element name="mvwdst" type="xsd:int"/>
    <xsd:element name="distributionNumber" type="xsd:int"/>
    <xsd:element name="contact" type="tns:Contact"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="formRequestElement" type="tns:FormRequest"/>
    <xsd:element name="personElement" type="tns:Person"/>
    <xsd:element name="departmentElement" type="tns:Department"/>
    <xsd:element name="vehicle" type="tns:Vehicle"/>
    <xsd:element name="loadFormReturn" type="xsd:boolean"/>
    <xsd:element name="editFormReturn" type="xsd:boolean"/>
    </xsd:schema>
    Wsdl File:
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="userWS" targetNamespace="http://j2ee.netbeans.org/wsdl/userWS"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://xml.netbeans.org/schema/Abruf38" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:tns="http://j2ee.netbeans.org/wsdl/userWS" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/userWS">
    <xsd:import namespace="http://xml.netbeans.org/schema/Abruf38" schemaLocation="Abruf38.xsd"/>
    </xsd:schema>
    </types>
    <message name="loadFormRequest">
    <part name="formRequest" element="ns:formRequestElement"/>
    <part name="person" element="ns:personElement"/>
    <part name="department" element="ns:departmentElement"/>
    </message>
    <message name="loadFormReply">
    <part name="retVal" element="ns:loadFormReturn"/>
    </message>
    <portType name="userWSPortType">
    <operation name="loadForm">
    <input name="input1" message="tns:loadFormRequest"></input>
    <output name="output1" message="tns:loadFormReply"/>
    </operation>
    </portType>
    <binding name="userWSBinding" type="tns:userWSPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="loadForm">
    <soap:operation/>
    <input name="input1">
    <soap:body use="literal"/>
    </input>
    <output name="output1">
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="userWSService">
    <port name="userWSPort" binding="tns:userWSBinding">
    <soap:address location="http://localhost:18181/userWSService/userWSPort"/>
    </port>
    </service>
    <plnk:partnerLinkType name="userWS1">
    <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.
    In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
    A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
    <plnk:role name="userWSPortTypeRole" portType="tns:userWSPortType"/>
    </plnk:partnerLinkType>
    </definitions>
    The message that Netbeans says when trying to put more parts to the message is:
    WS-I Basic Profile Rule R2210: If a document-literal binding in a DESCRIPTION does not specify the parts attribute on a soapbind:body element, the corresponding abstract wsdl:message MUST define zero or one wsdl:parts.
    Please...I am desperate, cause I am pressed by time!
    Can anyone tell me how can I make it work. Cause it is very common to use a Web service operation that has more than ONE parameter.
    I am waiting for your replys!

    Hi,
    Change the <soap:binding style="document"... to <soap:binding style="rpc"... and see if that works.
    I'm not sure how to get <soap:binding style="document"... working yet - I'm not that experienced in web services yet.
    Hope this helps and is not too late.
    Regards,
    Greg Nye

  • Creating JFrame from JDialog

    Hi ..
    I want to create a Frame from JDialog . But I am facig the problem the focus doesn't shift from dialog to this new frame which I created from this Dialog.
    Any ref. and approach ....plz do let me know.

    post the code here

  • I can't don't understand code in netbean and it's about Jframe.

    i use netbean to design 2 jframe with some buttons on both frame.
    frame1 is login form, frame2 is mainform. i want to show loginform then click the button1 to show 2nd jframe.
    then i click exit on 2nd jframe and it come back to loginform(frame1).
    i do alot of search on the google and here. i know the basic to show a jframe using
    setVisible or .show() .hide(), etc..
    the problem is what is my jframe variable name in netbean?
    i know i can create an jframe object
    such as: JFrame frame1 = new JFrame(); etc.. (it's ok if the syntax is wrong for now).
    When i use netbean, i drag the Gui components to the Jframe. The jframe is generated by netbean automatically.
    When the main program runs, it calls main() method, follow by :
    public void run() {
    new LoginForm().setVisible(true);
    new LoginForm().setVisible <--- setVisible(true) means show the form.
    and is new LoginForm() create an object from LoginForm class.
    public LoginForm() {
    initComponents();
    When it create a new object, it runs default constructor and calls iniComponoents and finally show the jframe.
    my question is when you create object, you usually declare variable and use variable to hold reference to the object.
    that's why i don't understand how it works here.
    it only create news object, bu no variable to holding it. how do i control this Jframe to show and hide without a reference variable????????????
    Edited by: roadorange on Feb 29, 2008 10:08 PM

    roadorange wrote:
    Encephalopathic . thank your reply so much. your reply is fast. i love it and love this forum.. LOLyou're welcome
    i tried hand-written code, and it looks just fine when design few buttons, labels and textfields.
    The adjustment of buttons(labels) are not that good on the frame.
    However, when you use IDE, you can drag the button on any spot you like in the jframe.... and in the process not learn how Swing works, and lose flexibility and power. Sorry to sound conceited, but I'll match any of your netbeans-created GUI's with one of my own, and mine will likely be better -- and I'm not all that good at this just yet.
    Much luck.

  • Close JFrame in Netbeans

    Hello,
    I have a java application in NetBeans. I have been using Netbean absolut layout. I didn´t create JFrame class variable at all, instead using:Ok is a button
    ok.setFont(new java.awt.Font("Arial", 0, 10));
    ok.setToolTipText("ok");
    ok.setLabel("ok");
    ok.setMargin(new java.awt.Insets(2, 2, 2, 2));
    getContentPane().add(ok, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 150, 60, 20));
    ok.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    okPerformed(evt);
    I don´t want to use System.exit(0); because it will shut down whole system. In order to use dispose method, I created a JFrame class variable in beginning of the class, but it doesn´t work.
    JFrame frame = new JFrame();
    public void okPerformed (java.awt.event.ActionEvent evt){
    this.frame.dispose();
    Can anyone help me?
    Thanks

    hello,
    Thanks for replying my message so fast.
    I tried, but it still doesn´t work. I am using netbeans absolute Layout. It doesn´t really have frame. Here is my code
    public class tt extends JFrame{
    JFrame frame = new JFrame();
    JTextField text1= new JTextField(20);
    JButton ok = new JButton();
    public tt throws Exception
    setSize(400,300);
    setTitle("tt");
    getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    text1.setFont(new java.awt.Font("Arial",0,12));
    text1.setBounds(5, 8, 5, 5);
    text1.setEditable(true);
    getContentPane().add(text1, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 30, 100, 20));
    ok.setFont(new java.awt.Font("Arial", 0, 10));
    ok.setToolTipText("ok");
    ok.setLabel("ok");
    ok.setMargin(new java.awt.Insets(2, 2, 2, 2));
    getContentPane().add(ok, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 150, 60, 20));
    ok.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    okPerformed(evt);
    setVisible(true);
    public void okPerformed (java.awt.event.ActionEvent evt){
    setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
    Thanks

  • Changing panels in frame at runtime using NetBeans

    Hi there,
    I'm having trouble changing JPanels in a JFrame at runtime when they were both generated in NetBeans. I find that I can do this easily in a manually coded GUI with the code below. However with NetBeans generated frames and panels it doesn't seem to work.
    So all I really would like to learn is how to change JPanels in a JFrame at runtime when both are generated by NetBeans (New>JFrame Form... and New>JPanel Form...) Any help would be much appreciated.
            // reset panel
            pMain.removeAll();    // main panel added to nb generated frame
            pMain.validate();     // call layout manager
            testPanel = new TestPanel();  // this class extends JPanel (generated)
            pMain.add(testPanel);     // add new panel
            pMain.setVisible(true);     // update panel
            pMain.revalidate();
            pMain.repaint();

    Changing the layout to BorderLayout and adding the new panel to BorderLayout.CENTER with your code sample above doesn't seem to work though.This works for me.
    I created a frame form and a panel form then set the frame layout to border layout and added a remove/add panel at the south.
    frame code looks like this.
    import java.awt.BorderLayout;
    public class MainFrame extends javax.swing.JFrame {
    private boolean isAdded;
    private TestPanel panel; // this is the panel form
    /** Creates new form MainFrame */
    public MainFrame() {
    isAdded = false;
    initComponents();
    // Generated code
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    if(!isAdded) {
    panel = new TestPanel();
    add(panel, BorderLayout.CENTER);
    pack();
    isAdded = true;
    } else {
    remove(panel);
    isAdded = false;
    validate();
    repaint();
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new MainFrame().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    // End of variables declaration
    Somehow I find it very hard to believe that NetBeans is not production ready....The reason we don't use the DnD in nb is that the generated code is not editable and it's hard to maintain.

  • Problem displaying CheckboxGroup on JFrame

    I was recently assigned the task of creating exams. I am trying to create a CheckboxGroup in a class that was passed the Graphics2D tool. This code compiles with no errors when I call it's method:
    setLayout(new GridLayout(1, 5));
              CheckboxGroup cbg = new CheckboxGroup();
              add(new Checkbox("Never", cbg, false));
              add(new Checkbox("Almost Never", cbg, false));
              add(new Checkbox("Sometimes", cbg, false));
              add(new Checkbox("Almost All The Time", cbg, false));
              add(new Checkbox("All The Time", cbg, false));
    but nothing displays on my JFrame, I tried to draw it with this line(g2 is my Graphics2D tool):
    g2.draw(cbg);
    but I get an error when compiling that says draw doesn't work. Am I totally off-track with this or is there a simple Graphics2D method that I use to draw this CheckboxGroup?

    hiwa: Thanks for the tip, I won't mix those libraries anymore
    pete: Here is all of my code so far sorry it's sloppy, I'm just getting back into coding after one semester of Intro to Computer Science using Java almost a year ago::/*this class has main function**************************************************/
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    public class PDS_Questionnaire
         public static void main(String[] args)
              //declare JFrame window dimensions
              int WIDTH = 500;
              int HEIGHT = 400;
              //create JFrame
              JFrame frame = new JFrame();
              frame.setSize(HEIGHT, WIDTH);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //create object of painter class to install onto frame
              ScoreCard survey = new ScoreCard();
              //add object to frame and set visible
              frame.add(survey);
              frame.setVisible(true);
    /*********************end of class***************************************/
    /****************************new class**********************************/
    //this class is the JFrame painter, it initiates the Graphics2D class then passes the
    //Graphics object to PDS_Scorer so that the PDS_Scorer class can draw on the patientsCard
    import javax.swing.JComponent;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    public class ScoreCard extends JComponent
         public ScoreCard()
         public void paintComponent(Graphics g)
              //recover Graphics2D
              Graphics2D g2 = (Graphics2D) g;
                    //create another class and pass the Graphics2D tool
              PDS_Scorer patientsCard = new PDS_Scorer(g2);
                    //call method to draw the check boxes
              patientsCard.drawCheckBoxes();
    /*********************end of class***************************************/
    /****************************new class**********************************/
    import javax.swing.JComponent;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GridLayout;
    import java.awt.Checkbox;
    import java.awt.CheckboxGroup;
    public class PDS_Scorer extends JComponent
         public PDS_Scorer(Graphics2D gTwo)
              g2 = gTwo;
         public void partA_Scorer()
         public void partB_Scorer()
         public void partC_Scorer()
         public void partD_Scorer()
         public void partE_Scorer()
         public void partF_Scorer()
         public void drawCheckBoxes()
    //           draw3DRect(int x, int y, int width, int height, boolean raised)
    //      Draws a 3-D highlighted outline of the specified rectangle.
              g2.draw3DRect(10, 10, 10, 10, true);   //this works
              setLayout(new GridLayout(1, 5));
              CheckboxGroup cbg = new CheckboxGroup();
              add(new Checkbox("Never", cbg, false));
              add(new Checkbox("Almost Never", cbg, false));
              add(new Checkbox("Sometimes", cbg, false));
              add(new Checkbox("Almost All The Time", cbg, false));
              add(new Checkbox("All The Time", cbg, false));
            //g2.drawString("One Lazy Fox", 22.5, 55.5);
         private Graphics2D g2;
    }

Maybe you are looking for

  • How do I resize all symbols in a project???

    So I'm trying to figure out how I can scale my flash project to fit the screen. The problem is that when I export the project to an .avi there is a huge white background that is still showing in the project. I tried to scale the whole project up by s

  • Travel cost on projects

    Hello every one. This is regarding travel cost to be booked on project. In my project i m having HR/PS/TIME/ESS/TRAVEL/CATS AND FICO. now when i m book cost on the project in TRIP transaction code we can post on wbs but the problem is right now there

  • FIELD WISE Access Permission????? Help me

    Hi all, <b> I want to specify the Field level of Access Permission for the SBO Users. </b> For Example i) I have one Screen named 'SALES ORDER AMENDMENT' ii) Here i added four checkboxes for the CGM,HOD,Manager,Supervisor. <b> If the Manager login in

  • Navigational Attributes as Selection Criteria in Infopackage?

    Is it possible to use navigational attributes as selection criteria in the infopackage?  I have the MRP cube that only does full loads.  I would like to ONLY load the material type FERT (finished goods).  0MATERIAL has 0MATL_TYPE as a navigational at

  • Firefox 4 is not starting

    Whenever I try to start Mozilla firefox 4, it begins to load (little circle icon next to pointer) but then nothing happens. It is shown under processes in the task manager as running, but nothing in applications. And nothing visually comes up. I"ve t