Printing Buttons with Images

In my application, I am attempting to print a document that has both buttons with text and buttons with images, along with plain text.
When I print, the buttons with the images are larger than they ought to be (i.e. they don't fit within the area they were suppose to be drawn within (btw, for this application, I am using absolute positioning)).
However, this does NOT occur with the buttons that have only text and no image.
Can anybody tell me why this might be? It seems that to printing a JButton comes from the functionallity of JComponent.print, which simply sets a few printing flags and calls JComponent.paint.
So whatever changes those flags make, I would think they ought to effect all buttons the same?
Has anybody else run into this problem, and possibly found a solution for it?

myJButton.setSize(new java.awt.Dimension(<width>,<height>));
that line should do it. keep in mind that that will not resize your image. since you are using absolute positioning I will assume your button is of constant size. you should manually resize your images to be of the proper size for your buttons.

Similar Messages

  • Radio Buttons with images

    Hello everyone,
    JDeveloper 11.1.1.7.0
    Is it possible to have radio buttons with images instead of plain text?
    If not, are you interested in having this kind of feature? I am ;-)
    Thx.
    Filip Huysmans

    Hi Flip,
    The user when switching between modes will fire an event to the server. This even needs to be caught in a bean and set a variable's value to either true or false.
    Now you can treat "TRUE" to be in view and "FALSE" to be in edit mode.
    Depending on this images can be changed.
    Ex: your bean will be like
    class catchMode{
    private boolean mode;
    public void changeMode(ActionEvent ae)
    boolean modVal=this.getMode();
    if(modVal) //if mode is true; i.e. view mode
         this.setMode(false);
    else if(!modVal) //in EDIT mode
    this.setMode(true);
    //Generate accessors for mode
    in JSPX:
    <af:image source="#{catchMod.mode eq true ? 'view.png' : 'edit.png'}"
    Also the partialSubmit for the command component will be set to true
    Thanks,
    Pandu

  • Print document with images error

    I have a problem with Word 2013 document management with images in my project. By using the scrollbars to scroll through the images, they disappear leaving an empty document space ("placeholder") instead. I interpret that are downloaded
    from  the view. The most serious problem is that this images are not printed afterwards.
    Details
    The project is made by a "addin" application level on word 2013, created in Visual Studio 2012 (Framework 4.0), from which you can initiate actions based in our business logic. Including a list of images is inserted into the active document.
    To insert the images I've tried various techniques (interop, open xml) to verify that my problem is related to a defect in this part. I also tested load different images each time (bmp, jpg).
    When I insert images into two documents within the same session of word and use the scroll to move from one image to another repeatedly, some are downloaded from the print view. This process can replicate completely closing and reopening word
    2013 and then open these documents afterwards. Opening the documents opens the "addin" too. If I uninstall the addin the effect does not occur. However this addin dont use in the loading process any  logical business or load sessions database.
    Only load a few basic buttons.
    Can anyone give me any explanation or solution to this effect?

    document examples:
    https://onedrive.live.com/redir?resid=A0312CFD425175AF!108&authkey=!APZWb_nUFHmecNM&ithint=file%2cDOCX
    https://onedrive.live.com/redir?resid=A0312CFD425175AF!109&authkey=!AHLP6WG7KGRyaBs&ithint=file%2cDOCX
    Add new Addin for word by VS2012, it's indiferent,
     I've tried with
    a new Addin for Word and the problem persist.

  • PSD Rollover Button with image in front stops button from changing state

    I have a wide PSD button that changes state when rolled over. I would like to place a PNG image with transparency in some areas over the top of it so that the rollover button shows through the transparent areas of the PNG.
    How can you get it to do the rollover effect when the user mouses over the bit of the button that the image is in front of? Is ther a way of making the PNG 'invisible' to the mouse?
    I know I could redesign the button so that it includes the image but I'm trying to keep file sizes and load times to a minimum, I use this button a lot on my website with a different on each, and having that number of individual buttons would result in a bloated, slow-loading website.

    Hi Abhishek
    Thanks for your reply. I was able to achieve the effect I wanted by having the PNG and the PSD Button with the same link and then grouping them. This means I can mouse over the PNG and still get the PSD rollover effect, which is perfect.
    However I also have another similar problem. I have some different PSD Rollover Buttons which have some text in front of them (basically it's the button label). On some of these buttons when you roll over the text it prevents the rollover state of the button, and on other buttons the rollover effect occurs as it should, and there doesn't appear to be any consistency about which does what. Grouping or ungrouping doesn't appear to make a difference. Can you help?

  • Replace Buttons with Images.

    Folks,
    I have buttons in my application which perform a certain functions
    by clicking on them.
    I want to replace the buttons by gif/jpg images,so that when the
    user clicks on them,it does the same set of functionality as discussed
    above.
    HOW CAN I REPLACE THE BUTTONS with Gif and implement the actionListener??

    Hello,
    there are several methods to set the icon for the button like setIcon and setRolloverIcon etc. You better setContentAreaFilled(false) if you want an icon-only button. Have a look at [url http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/AbstractButton.html]AbstractButton for further information.
    Regards,
    Tim

  • Button with image in JSP

    In JSP, how could we create a button with an image on it.
    Normally in JSP we use something like :
    <input type="submit" name="ButtonName" value="Submit"> to create a button
    and we use < request.getParameter("ButtonName")> to invoke it.
    How can we create a button with an image? and how to invoke the button. Thanks.

    Not too sure how you are invoking with the request.getParameter() (I'm still fairly new to JSP), but you can certainly create a submit button with an image by using:
    <input type="image" src="buttonimage.gif" height="100" width="100" name="ButtonName" value="Submit" />(Where or course src, width and height are dependant on your image.)
    Hope that helps.

  • The print button with Win8.1 in any pages don't work, only empty papers

    Many web pages contain a print button to print content. Since the upgrade to win 8.1 these buttons no longer work. in other browsers work the same pages properly.

    Many print buttons launch a new window with a reformatted page more suitable for printing. If the problem is with the new windows, it could be the Firefox pop-up blocker, or a pop-up blocker in an extension or external security software.
    To manage the built-in popup blocker, see: [[Pop-up blocker settings, exceptions and troubleshooting]].
    To determine whether an extension is a likely culprit, you could test one of the problem sites in Firefox's Safe Mode. That's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • Buttons with images in web!!! Please help-me!!!!

    I want to publish mine forms 6i in web. They have buttons with figures. I already converted the figures of .ICO for .GIF. I already read diverse papers on the subject but I did not understand them. What I must make now?
    I need step-by-step that to make now, therefore I have stated period to carry through this task and is if depleting. Who to know, please says which archives to me must edit, where to place the figures, etc.
    Thanks!!!!!

    Joao,
    There is Registry.dat file in which there are two items:
    default.icons.iconpath=
    default.icons.iconextension=
    My Registry.dat contains this:
    default.icons.iconpath=/nis-img/
    default.icons.iconextension=gif
    The url /nis-img/ is defined in httpd.conf (I use Apache).
    kind regards,
    Ivan
    I want to publish mine forms 6i in web. They have buttons with figures. I already converted the figures of .ICO for .GIF. I already read diverse papers on the subject but I did not understand them. What I must make now?
    I need step-by-step that to make now, therefore I have stated period to carry through this task and is if depleting. Who to know, please says which archives to me must edit, where to place the figures, etc.
    Thanks!!!!!

  • Print Button with blank Pop Up

    While trying to print a crystal report through crystal viewer the print button is showing blank and staying still for long time. We are not able to print the report through the viewer.
    Any solution please

    Firstly it would be handy to know what version of CR you are using?
    Is this a standalone application? If so the Print Control is an ActiveX plug-in which requires permissions.
    Don

  • Flash button with images

    hi,
    I want to create a flash button,& for the button
    different images should load for press & release events. also I
    want to reuse this button. Please can someone tell me how to do
    that

    you'll need to use server-side scripting to handle part of the file upload and the file name retrieval from the upload folder.  assigning the uploaded files names you'll do from flash.  you'll use another script to retrieve the file names and in flash load and display which ever subset you want.

  • Problems: button with image

    hallo,
    i have the following problem:
    I've written this class:
    import java.awt.*;
    public class ImageButton
    extends Button
         private Image img;
         public ImageButton(String fname)
         img = getToolkit().getImage(getClass().getResource(fname));
              MediaTracker mt = new MediaTracker(this);
              mt.addImage(img, 0);
         try {
              //Warten, bis das Image vollst�ndig geladen ist,
              //damit getWidth() und getHeight() funktionieren
              mt.waitForAll();
              } catch (InterruptedException e) {
              //nothing
         public void paint(Graphics g)
              int a=(this.getWidth()-getPreferredSize().width)/2;
              int b=(this.getHeight()-getPreferredSize().height)/2;
              g.drawImage(img,a,b,this);
              super.paint(g);
         public void update(Graphics g)
              paint(g);
         public Dimension getPreferredSize()
              return new Dimension(
              img.getWidth(this),
              img.getHeight(this)
         public Dimension getMinimumSize()
              return new Dimension(
              img.getWidth(this),
              img.getHeight(this)
    when the frame appears, where the button is shown, the icon is shown. But when I click on the button, the icon is away and i don't know, where is the problem.
    I don't use swing because i don't like the perfomance.
    why is the image away, when i'm clicking on the button or another frame is over the button and disappears.

    just do not call super.paint(g) in paint() implementation

  • Problem printing Report with Image in BI Publisher 11g

    I am working with BI publisher *11g* but I have problem printing images. Everything works fine if I do not include any images however when I add a image I get following problems.
    When I tried printing PDF in output I get
    Type /Xobject
    subtype /Image
    Filter /DTDDecode .......
    When I tried printing HTML output I get
    Type /Xobject
    <html...
    ....>
    When I tried printing RTF I get
    { \fontb1 }
    { \f0 Arial;}
    { \f1 Times:}
    I think I am missing some BI publisher configuration. Can you help me in this regard.
    Thanks,
    Santosh
    Edited by: user4956795 on Jan 16, 2012 2:08 PM
    Edited by: user4956795 on Jan 16, 2012 2:18 PM

    Isn't there a way for you to do this via a Package/Procedure versus having multiple queries?
    Per the BI Publisher guide,
    Following are recommended guidelines for building data models:
    Reduce the number of data sets or queries in your data model as much as possible. In general, the fewer data sets and queries you have, the faster your data model will run. While multiquery data models are often easier to understand, single-query data models tend to execute more quickly. It is important to understand that in parent-child queries, for every parent, the child query is executed.
    You should only use multiquery data models in the following scenarios:
    To perform functions that the query type, such as a SQL query, does not support directly.
    To support complex views (for example, distributed queries or GROUP BY queries).
    To simulate a view when you do not have or want to use a view.
    Thanks,
    Bipuser

  • Adding Print Button With Java Script to Print of Different Pages Differently

    Hi,
    I am in the process of making a form and most of it is done and now I want to be able to print off two of the pages but to different printers, I have one that needs to be printed off on a regular A4 printer and another that needs to go to a label printer. I have both of the names for the printers and I have tried something but it just doesnt do anything at all (this is suggested by adobe I think?)
    var pp = this.getPRintParam();
    var printamount = this.getValue("Quantity_Boxes");
    pp.printerName = "Zebra Technologies ZTC GK420t";
    pp.firstPage = 3;
    pp.lastPage = 3;
    pp.NumCopies = 2*printamount;
    this.print();
    I tried it without the first and last page and nothing happens, I am useing a shared printer which works when I do cmd + P which the full printer name is Zebra Technologies ZTC GK420t @ User's iMac. (I have also tried putting the full name in aswell)
    This is just to test one page so far but is there any way that one button will be able to print off 2 different pages to 2 different printers?
    If someone knows how this would be a great help!
    Thanks,
    Bruce

    Thanks for that, I have it working now but it shows the dialog box with no settings changed should i use:
    pp.interactive = pp.constants.interactionLevel.automatic ?
    Thanks,
    Bruce
    EDIT:
    It printed but only the first page but it printed on the right amount quantity was 2*3 wich was the result of the Quantity_Box value
    I want it to print page 3 through the Zebra Printer and have page 2 printed to a different printer, is this possible through one button?

  • Invisible submit button with image rollover

    I have a need to combine a rollover image with a form submit
    button. I need the submit button to not be visible except for those
    that know where to look.
    I have a database query that displays rows of data. Each row
    has a checkbox to select that item, so the data table is in a form;
    the checkbox is a cfinput. In order to pass the parameters of the
    checked items, a submit button must be used to submit the form
    values.
    My need is for the submit button to be the rollover image.
    Only users that know where to find the rollover image will be able
    to submit the list of checked form values. "Regular" users
    shouldn't be in that area of the screen.
    So, a combined rollover image submit button is needed.
    Ideas? Thanks...Rick...

    document.yourformname.submit didn't work.
    But then discovered that the href value needs to be empty (or
    "#") to work. This code works: (rollover images with the submit()
    code):
    <a href="#"
    onClick="javascript:submit()"
    onmouseover="MM_swapImage('Image9','','images/change-meeting-date.png',1)"
    onmouseout="MM_swapImgRestore()">
    <img src="images/blank-hidden-area.png"
    name="Image9"
    width="111"
    height="11"
    border="0"
    id="Image9" />
    </a>
    When, in DW, you add the rollover image, you need to leave
    the href value empty. I suppose that lets the submit button use the
    <cfform action...> value as the results page, letting the
    form values pass to the results page.
    Now, the next step is to have two different rollover images
    with submits() that point to two different result pages, while
    still using one cfform. (Two submits in one form, each submit
    pointing to a different results page.)
    ...Rick...

  • WPF Buttons with Images

    I have the following button design that I'm aiming for:
    http://i.imgur.com/nCymK5L.jpg
    Could someone advise how I'd add an image to the left side of the button?
    Also, if anyone could advise if I can add the thin black border easily?
    My current markup:
    <Button Click="Example_Click" Margin="112,162,214,40">
    <Button.Template>
    <ControlTemplate TargetType="Button">
    <Border Background="#FFF" BorderThickness="4" CornerRadius="20" Width="125" Height="46">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="BorderBrush" Value="#CED58F"/>
    </Trigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <TextBlock Margin="30,6,0,0" FontSize="18" FontWeight="Bold" Foreground="#9EB11C">BUTTON</TextBlock>
    </Border>
    </ControlTemplate>
    </Button.Template>
    </Button>
    Thanks

    >>Could someone advise how I'd add an image to the left side of the button?
    You could just put a Grid with two columns inside the Border element and then put the image in the leftmost column of the Grid:
    <Button Click="Example_Click" Margin="112,162,214,40">
    <Button.Template>
    <ControlTemplate TargetType="Button">
    <Border Background="#FFF" BorderThickness="4" CornerRadius="20" Width="125" Height="46">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="BorderBrush" Value="#CED58F"/>
    </Trigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Image Width="25" Height="25" Grid.Column="0" Source="pic.png" Stretch="Fill" Margin="5 0 0 0"/>
    <TextBlock VerticalAlignment="Center" Margin="3 0 0 0" Grid.Column="1" FontSize="18" FontWeight="Bold" Foreground="#9EB11C">BUTTON</TextBlock>
    </Grid>
    </Border>
    </ControlTemplate>
    </Button.Template>
    </Button>
    >>Also, if anyone could advise if I can add the thin black border easily?
    You could add another inner Border inside the outer one. Something like this:
    <Button Click="Example_Click" Margin="112,162,214,40">
    <Button.Template>
    <ControlTemplate TargetType="Button">
    <Border x:Name="outerBorder" Background="#FFF" BorderThickness="4" CornerRadius="20" Width="125" Height="46">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="BorderBrush" Value="#CED58F"/>
    </Trigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <Border BorderThickness="1" CornerRadius="20">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <DataTrigger Binding="{Binding Path=IsMouseOver, ElementName=outerBorder}" Value="True">
    <Setter Property="BorderBrush" Value="Gray"/>
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Image Width="25" Height="25" Grid.Column="0" Source="pic.png" Stretch="Fill" Margin="5 0 0 0"/>
    <TextBlock VerticalAlignment="Center" Margin="3 0 0 0" Grid.Column="1" FontSize="18" FontWeight="Bold" Foreground="#9EB11C">BUTTON</TextBlock>
    </Grid>
    </Border>
    </Border>
    </ControlTemplate>
    </Button.Template>
    </Button>
    Hope that helps. It should at least get you the idea :)
    Please remember to mark helpful posts as answer and/or helpful.

Maybe you are looking for