How to create an ImageIcon from other ImageIcon's part?

I have an ImageIcon instance and want to create an other one from the specified part of the initial icon.
How can this be done??
Thanks. Boris.

If I were you, I would create a BufferedImage and paint the ImageIcon into it. You have the choice of either :
- in the paint method itself, modify the clip bounds so as to make it only paint the desired region
- or paint the image completely and then use BufferedImage's getSubimage method
Either way, you'll get a BufferedImage that you can use to create your target ImageIcon

Similar Messages

  • Creating an ImageIcon from others ImageIcon

    Hi,
    I want to write a method that create an ImageIcon object from two ImageIcon objects passed.
    ImageIcon createImageIcon(ImageIcon img1, ImageIcon img2) {
    ImageIcon img;
    return img;
    The returned ImageIcon displays as the two img1 and img2 placed side by side.
    Thanks very much,
    Charly

    Thanks to camickr and stevops,
    this is my working method (mainly the camickr code).
         public static ImageIcon createImageIcon(ImageIcon icon1, ImageIcon icon2) {
              int width = Math.max(icon1.getIconWidth(), icon2.getIconWidth());
              BufferedImage image = new BufferedImage(width, icon1.getIconHeight() + icon2.getIconHeight(), BufferedImage.TYPE_INT_RGB);
              Graphics g = image.createGraphics();
    //          g.drawImage(icon1.getImage(), 0, 0, icon1.getIconWidth(), icon1.getIconHeight(), null);
    //          g.drawImage(icon2.getImage(), 0, icon1.getIconHeight(), icon2.getIconWidth(), icon2.getIconHeight(), null);
              icon1.paintIcon(null, g, 0, 0);
              icon2.paintIcon(null, g, 0, icon1.getIconHeight());
              g.dispose();
              return new ImageIcon(image);
         }Bye

  • How to create view/table from other user's view/table

    Hi all
    I'm using Oracle database 10g.
    I create table/view on user XXX, how to I create table/view on user YYY from user XXX.
    Thankyou,
    Thiensu2810

    user8248216 wrote:
    Hi all
    I'm using Oracle database 10g.
    I create table/view on user XXX, how to I create table/view on user YYY from user XXX.
    Thankyou,
    Thiensu2810grant select on xxx.table_name to yyy;
    create table/view table/view_name as select * from xxx.table_name;

  • How to create iCal events from other applications?

    I want to create event linked with a certain document, e.g. when I've finishes a letter in Pages or in TeXShop, I want to create an event in iCal for reminder. I know, that I can in iCal create events and add the link to the file into the URL field of an event. But I want in Pages, TeXShop, Numbers, … to click: »Create reminder in iCal on <date>.«
    Is there a way for it?

    Cody,
    Read: http://discussions.apple.com/thread.jspa?messageID=8314404&#8314404
    You can use Firewire Target Disk mode: http://support.apple.com/kb/HT1661 to transfer the appropriate iCal files.
    ;~)

  • How do I move objects from other package to a newly created one?

    How do I move objects from other package to a newly created one?
    Thanks!

    Dear Anthony Pham ,
    for changing objects from one package to another package
    open that object for example Report
    open the report and than click GOTO select OBJECT DIRECTIORY ENTRY
    than it will open a popup in that popup click the change and give the new package
    Thanks
    Surendra

  • How to reject ACK/NACK from other Send Ports to Orchestration

    Hi Everyone,
    I have a below scenario, Please let me your ideas how can we avoid ACK from other send ports (If there is any failures), in my current scenario getting issues or conflicts because of this
    AckRequired.
    Key points in my scenarios
    SendPort_A is pointing to SAP
    SendPort_B is pointing to SQL
    Flow
    Receive MessageA and Transform to MessageB format, send MessageB to SendPort_A which directly bind to orchestration with transmitted property enabled.
    SendPort_B subscribes the same message, output of map with message type as filter condition (we are not expecting any Acknowledge from sendPort_B, because it’s a generic send port for some scenario).
    Problem
    When I see the context properties both send ports has AckRequired
    Property to true (so getting ACK/NACK from both send ports).
    I want acknowledgement only form SendPort_A which is bind to orchestration with transmitted property enabled, but not from the SendPort_B which subscribes just with message type.
    I have tried the below points but no luck
    Created custom pipeline with custom pipeline component to set / overwrite
    AckRequired Property to false (Pipeline component is working fine, but nothing is overwriting in context, getting acknowledge back to orchestration for any failure in SendPort_B)
    #region IComponentUI
    public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
    pInMsg.Context.Write("AckRequired", "http://schemas.microsoft.com/BizTalk/2003/system-properties", false);
    return pInMsg;
    #endregion
    Below images gives some info on the same scenario.
    Appreciate your suggestions.
    Thanks, SMS Vikas K

    Hi Vikas,
    Let me know if I understood correctly.
    SendPort_B subscribes the same message, output of map with message type as filter condition (we are not expecting any Acknowledge from sendPort_B, because it’s a generic send port for some scenario).
    Problem
    You have a send port B which is subscribing to the same message using the message type.
    You can set additional filters to ignore Acknowledgement-
    Ex- Mgtype= "" AND
    AckRequired!=True OR
    AckRequired!=False 
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Can not open JPEG files and can not create JPEG files from other software

    Can not open JPEG files and can not create JPEG files from other software (For example from Solidworks).
    When I try to right click on a JPEG, a notice window appears written: "Windows Explorer has stopped working - Windows is
    checking for a solution to the problem" and then the notice box disapears, the desktop appears and I can continue working.
    From the other side - If I try to save as JPEG a screen of Solidworks (like a view of a part) the Solidworks falls but the JPEG
    is created (I can see its name in the directory I created it).
    I can open the JPEGS with the Paint software if I want but not with the Windows Photo Viewer.
    I have the feeling that the Windows Photo Viewer disapeared from my computer - just a feeling.
    I will appreciate your assistance.
    Avi T. 2014

    Hi,
    Did Windows Photo Viewer option appear when you right click the JPEG file and select open with?
    I would like suggest you use Clean Boot to troubleshoot if there is third-party software conflict:
    How to perform a clean boot in Windows
    http://support.microsoft.com/kb/929135
    Karen Hu
    TechNet Community Support

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How to create an invoice from multiple sales doc.

    Hi,
    how to create an invoice from multiple sales doc.
    thanx,
    sourav

    hello, friend.
    assuming that your settings in VTFA and VTFL allow, you can create 1 invoice for many sales orders or deliveries by using VF04.  choose all documents that apply and click "collective billing document". 
    you can also click on "simulation" if you want to test if the combination is possible and the system will give you a split analysis if this is not possible.
    regards.

  • How to create set hierarchies from FI SL.

    Hi Experts,
    How to create set hierarchies from FI SL. Could you please tell me
    Step by step procedures or send to this mail id [email protected]
    Thanks
    Regards,
    Sathis.J

    Hi,
    FI-SL
    http://help.sap.com/saphelp_nw2004s/helpdata/en/28/5ccfbb45b01140a3b59298c267604f/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/41/65be27836d300ae10000000a114b54/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/cd143c5db89b00e10000000a114084/frameset.htm
    Hope This Helps.
    Thanks,
    Sankar M

  • How to create database link from oracle to sql server

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal
    Hi Vishal,
    I found a lof of information regarding how to create a database link from Oracle to SQL Server, please see:
    https://www.google.co.in/?gws_rd=cr&ei=vd3XUvGFO8TgkAXqlYCADg#q=how+to+create+database+link+from+oracle+to+sql+server
    We discuss SQL Server related issue in this forum. If you have any more question regarding Oracle, please post it in Oracle communities forum for better support.
    Regards,
    Elvis Long
    TechNet Community Support

  • "Create Simple document" from other objects

    Scenario: Creating a document using option "Create Simple document" from other objects
    I have created a document type and defined the object link for Functional Location with option "create simple document"
    When clicking on create icon on the additional data tab on IL02 screen, The system asks for the document type and then the file to be uploaded.
    The document type that i have defined has the Description filed as mandatory field and hence i am not able to create the document.
    However, for the Document type when i set the description field as not mandatory the system creates DIR. But this DIR has no description.
    Please let me know if there is a BADI, using which i could set the Functional location name as the description OR if there is some enhancement by which the user is asked to enter the description when creating the document.
    Warm Regards,
    Vivek Mohankumar

    Hi Vivek,
    After my tests I would like to inform you that this is                  
    the standard system behavior as the document description field is       
    maintained as mandatory in transaction DC10. Please note that for the   
    simple creation of documents this should not be set as a mandatory      
    field.                                                                               
    The creation mode can be defined in transaction DC10 for each object    
    under 'Define object links'.                                                                               
    Please note that the value "1" for the creation of documents is used    
    to enable a user to simple attache a word file to an object             
    without going to the transaction CV01n. Therefore the system behaviour  
    is different then creating a document by CV01n and attaching a          
    file to it. With simple creation mode there should not be any           
    mandatory fields as the user cannot enter anything during the creation  
    process.                                                                               
    However, you can change the behaviour how the document is created by    
    MM02 transaction if you change the customizing in transaction DC10      
    like this:                                                                               
    If you maintain the value "2" for creation of documents, the user is    
    put to transaction CV01n and then the description can be entered. So    
    maybe this would solve the issue.  
    Regarding a useful BADI I can only recommned you to test BADI DOCUMENT_OBJ1,
    DOCUMENT_OBJ2 or DOCUMENT_MAIN01 for fill the description field.
    I hope this information could be useful for you and help to avoid the   
    mentioned error message.                                                                               
    Best regards,
    Christoph

  • How to Create adf table from java bean

    Hi,
    How to Create adf table from java class (Not from ADF BC).
    Thanks
    Satya

    @vlsn -- you have to follow what shay said.
    Do the following in Model layer ::
    create a table property java class with your columns setters and getters like :
    *public class gridProps {*
    private int sno;
    private String orderNum;
    *public void setSno(int sno) {*
    this.sno = sno;
    *public int getSno() {*
    return sno;
    *public void setOrderNum(String orderNum) {*
    this.orderNum = orderNum;
    *public String getOrderNum() {*
    return orderNum;
    Create another table java class which will populate the values to your column values and return the collection :
    *public class gridPopulate {*
    private  List<gridProps> gridValues ;
    *public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
    *if (valuesToSet == null) {*
    return gridValues;
    gridValues = new ArrayList<gridProps>();
    if(btnValue.equals("completeBtn"))
    return gridValues;
    for(ArrayList<String> tempArr:valuesToSet)
    gridProps gp = new gridProps();
    gp.setSno(Integer.valueOf(tempArr.get(0)));
    gp.setOrderNum(tempArr.get(1));
    return gridValues;
    Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
    Thanks.(My jdev version 11.1.1.5.0)

  • How to create session id from different string controls

    how to create session id from different string controls

    fais,
    Please create the VI you are talking about and save some default data into all of the controls. Also on the front panel, place the session ID that should be generated by that data. Now, post your VI to a response so I can download it. I can then take this VI and help you create the functionality. (Please post what version of LabVIEW you are using.)
    My guess it that you are going to need to use a good number of string concatenations as well as a few string indexes to get parts of strings out. As for the date, you can use a Property node with the Numeric Text.Text property to get the actual string displayed on the front panel for the date and parse out the parts that you want.
    Randy Hoskin
    Applications Engineer
    National Instruments
    h
    ttp://www.ni.com/ask

Maybe you are looking for

  • How do I make Vertical Spry Menu appear in IE

    The URL in question is: http://www.ambppct.org/index_menu.php I have inserted a Vertcal Spry Menu on this page. It functions perfectly in Safari, Firefox and IE 8. However it does not appear in previous versions of IE. Below is the css file: @charset

  • ABAP code for calculation rule in TK = M/08

    Hi, In M/08 transaction, we need the following: When maintaining a PO, the user manually creates a condition like this: ZXXX    Value (+10 %) positive value. However, in order to get the belonging negative condition (for accounting purpose), we need

  • HTML to PDF converer

    Hello friends, I just want to convert simple HTML page to PDF using JAVA code.. Can anybody help me...?? Thanks Nishith Shah.

  • No GPS lock in the Dominican Republic

    I have installed this version of 3.06 on my Nokia 5230 Nuron ovi_maps_installer_3.06_11wk7_b11_s60_5.0_nocs_beta.sis which works very well in the USA. I have no data plan with T-mobile so I do not use any internet connectivity to assist the GPS. I we

  • HTTP Get & Post

    Hello All, I am looking for a way to get a URL specified by an applet property value, then HTTP Post to a hard coded URL. Has any one seen a simple way to do this? I havn't figured out an easy way, as this must run in Internet Explorer on the client'