Border around cells

Hi all!
I have looked at the DefaultTableCellRenderer. This draws a border around one cell. Is it possible to draw a border around several cells, so that they form a "block of cells".
Johan

jtable painting is done cell by cell. To get border around few blocks you need to use your own UI class.Please look into BasicTableUI.java , there you'll find paintRow( ) method that'll delegate the call to paintCell for each cell painting. override paintRow to paint border around few cells after the paintCell operation for all the columns in that row is completed. This can be done by getting getCellRect for the required columns and adding to get a bigger rectangle and painting that rectangle.

Similar Messages

  • When I have a border around a group of cellsand remove it, it also removes the grid lines. When I go to print the sheet, there are blank spaces where the border had been. I'm sing a MacBook.

    When I have  a border around a group of cell, how do I remove it. If I outline the cells again and then show in the Inspector NO BORDER, it removes not only the borderbut when I go to print it also the grid lines.

    What application are you using? Numbers? Excel? Something else?
    For help with Numbers spreadsheets go to this forum.
    If you are using Excel, Microsoft has a forum to help you.
    If it is something else, let us know what and we will try to point you in the right direction.
    Best of luck.

  • Can't get rid of white border around image

    http://www.gunnar.ca/laminatepage2.htm
    I created a rounded corner in photoshop for my table. I
    created a cell in the bottom left corner of the table and placed
    the gif. There is a thin whit border around the outer edge of the
    gif, so it doesn't look genuinely rounded. Can anyone tell me how
    to get rid of that so it looks like the table is actually rounded?
    Thank you!

    Because the table containing the GIF has a border. In your
    styleA.css
    stylesheet, the rule:
    .border {
    border: 1px solid #E5E5E5;
    adds a border to the table. Delete the rule. Of course - that
    may affect
    other things that use the .border class. Or - delete the
    class from the
    table tag.
    Several problems with the page:
    styles.css cannot be found
    sideNavStyles.css cannot be found
    34 vaildation errors:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.gunnar.ca%2Flaminatepage2.htm
    Alec
    Adobe Community Expert

  • How do I put an outline border around a table i.e. without internal borders being displayed?

    Hi
    I'd appreciate some help with putting a border around a table
    as I'm sure
    I'm not doing this the best way!
    I selected my table then chose a thin (size 2) border and
    desired colour.
    The problem is this has put a border around every cell in the
    table.
    Trying to remove the internal borders has been very
    frustrating!
    Just be clear, when I say "remove the internal borders" I
    don't want to
    merge cells I just want to stop the borders displaying.
    So...
    Is there a quick way to simply put an outline border around
    the table?
    What is the best method for removing internal borders?
    Having got so used to the ease of formatting tables in MS
    Word this is a bit
    of a hair puller!!
    Thanks for your time.
    Happy New Year!!
    Ian

    Don't use the property inspector to add the border - you will
    need to use
    css...
    examples here:
    http://www.dreamweaverresources.com/tutorials/tableborder.htm
    Nadia
    Adobe® Community Expert : Dreamweaver
    Tutorials |SEO |Templates
    http://www.DreamweaverResources.com
    http://www.perrelink.com.au
    CSS Tutorials for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/css.html
    "Ian R" <[email protected]> wrote in message
    news:eniufa$iaq$[email protected]..
    > Hi
    >
    > I'd appreciate some help with putting a border around a
    table as I'm sure
    > I'm not doing this the best way!
    >
    > I selected my table then chose a thin (size 2) border
    and desired colour.
    >
    > The problem is this has put a border around every cell
    in the table.
    >
    > Trying to remove the internal borders has been very
    frustrating!
    >
    > Just be clear, when I say "remove the internal borders"
    I don't want to
    > merge cells I just want to stop the borders displaying.
    >
    > So...
    >
    > Is there a quick way to simply put an outline border
    around the table?
    >
    > What is the best method for removing internal borders?
    >
    > Having got so used to the ease of formatting tables in
    MS Word this is a
    > bit of a hair puller!!
    >
    > Thanks for your time.
    >
    > Happy New Year!!
    >
    > Ian
    >

  • Want a border around header in spreadsheet

    I am totally frustrated. Need to get a border around the title of my spreadsheet. Title has been entered as a header. No matter what I do (and I am totally embarrassed to say I have been at this for hours now!) I cannot get a border around that header. I can put all kinds of borders around any cell in the spreadsheet. . . .which I don't want. . . .but not around that header.
    I would be so, so grateful for any help.
    Lee

    It ain't pretty, but it'll get you there...
    In your spreadsheet document, click on the toolbox to show tools.
    Choose the text tool and drag out a text frame. Insert your intended header text. Set the desired font and other text attributes. Center-justify your text (and pad it with a leading and trailing carriage return, if you need more height -- increase or decrease the text size associated with the leading and trailing carriage returns for vertical height/centering). Click outside the text frame, choose the arrow tool, select your frame (you should see its handles) -- adjust the frame to the desired width. Activate the "Pen Formatting" button, then choose the color you desire for your border from the color palette. Set the desired line weight for your border. Now Copy the frame to the clipboard. Position your cursor in the header area and paste. Bob's your uncle.

  • Border around a label

    I am trying to create a black border around a label using awt. Is there any way to do this? I have been trying to do it by creating two labels, one black and one white, with the black one slightly larger and putting the white one on the same cell (am using GridBagLayout) as the black one, but that doesn't work, only the black one is visible.
    Perhaps there is a different approach that someone knows about?
    Thanks for any assistance!

    I suggest using swing instead of awt, and then use the JComponent.setBorder method. You can find the types of borders you can create in javax.swing.border package. You can also use the BorderFactory class to create these borders for you.
    The problem with trying to put two items in the same position in the gridbag layout is that the gridbag layout (can) resize the components to fill the space, for one, so it might be resizing both components to the same size. Also, there is not concept of a z-index, so there is no guarantee which one will be painted first.
    - Adam

  • Drawing a lowered / raised bevel border around column headers

    Hello,
    I have a JTable and I want that every time while the user is pressing the mouse button down on one of the column headers, it will be drawn with a lowered bevel border around it, and with a raised border while it is not pressed. The problem is that the renderer of the headers has no way of knowing the state of the mouse button when it is requested to draw itself...
    Does anyone know how I can accomplish this effect?
    Thanks.

    Create your own renderer which has a field to indicate which one of the columns to draw with a lowered bevel border around it. (column number is passed into getTableCellRendererComponent, so you know which column is being rendered)
    Add a mouse listener to the header which tells the renderer which column has been clicked on.
    The cell renderer also needs to implement TableColumnModelListener, so that the depressed column index tracks re-ordering of the columns.
    Pete

  • The border around JCheckBox

    Hi,
    Who can tell me that how to remove the border around JCheckBox? My JCheckBox is the default renderer for boolean type data of JTable.
    Thank you.
    Janet

    Sorry, I still have a problem.
    I have written my own Icon class and the paintIcon method as following:
    public void paintIcon(Component c, Graphics g, int x, int y) {
    JCheckBox cb = (JCheckBox)c;
    ButtonModel model = cb.getModel();
    int controlSize = getControlSize();
    boolean drawCheck = model.isSelected();
    if ( model.isEnabled() )
    if (model.isPressed() && model.isArmed())
    g.setColor( MetalLookAndFeel.getControl() );
    g.fillRect( x, y, controlSize-1, controlSize-1);
    g.setColor( MetalLookAndFeel.getControl() );
    } else
    g.setColor( MetalLookAndFeel.getControl() );
    g.drawRect( x, y, controlSize-1, controlSize-1);
    if (model.isSelected()) {
         drawCheck(c,g,x,y);
    But the model.isSelected() method will always return false, how could I get the actual bool value of table's cell? My cell renderer code is as following:
    public class BooleanCellRenderer extends JCheckBox implements TableCellRenderer
    public BooleanCellRenderer()
    super(new CheckBoxNoIcon(),true);
    public Component getTableCellRendererComponent(JTable table, Object checkBox,boolean isSelected, boolean hasFocus,int row, int column)
    return this;
    }

  • How do I print multiple (4) photos on one page with a border around each?

    How do I print multiple photos on one page with a border around each? I've gone the contact sheet route and adjusted the number of columns but there's only outer margins and very little white space between the photos down the middle of the page.

    Ok, now I feel stupid! I always thought I was printing 6 x 4 but now I realise I can't have done!!
    The photos that I used to print are approx. 5.2" x 4" (i.e. 4 fitted nicely on a page & I had to cut the boarder off).
    I guess I just need to play with different sizes under the 'custom' option in order to get the biggest possible picture!
    Thanks for the help

  • How can I create a white border around figures that are in an image? (CS 6; examples+image included)

    Hi,
    I have CS6 and am wondering how to create a white ("comic style"?) border around figures in an image, as in the examples below. I don't wish to include the black shadow of the border, just the white part.
    Examples:
    Here's the image I'd like to alter, making a white border around the outline of all five figures:
    I researched for quite a while but could find no instructions. It would be very much appreciated if someone knows and would be kind enough to share the technique! Thank you.

    If you make the image a layer (opposed to Background)...
    You could Select the blue with the Magic Wand as Semaphoric says, then fill with white.  Then choose Select - Modify Selection - Contract, and mask or delete the remaining pixels.  The Contract operation will give you a nice border the size you choose.
    For extra credit, you could use Refine Edge to make the selection more accurate.
    Click to see the image  against a dark background.
    -Noel

  • How can I print with black border around edge of image?

    I'd like to add a black border around the edge of certain images I'm printing. I know it's fairly trivial in Lightroom, but I can't see where this option is in Aperture. Is this lacking in Aperture, or am I just missing it? Many thanks.
    PS -- I'm aware there are some plug-ins that claim to do this, so if Aperture can't do this, please feel free to chime in with comments on the best plug-in for this task.

    Rich Hayhurst wrote:
    Here's what you need:
    http://www.apple.com/downloads/macosx/aperture/apertureborderfx.html
    Aperture BorderFX 1.1
    Thanks, Rich. That's a good plug-in, and does cover what I need (with lots of other features, too). The problem, though, is it requires an export of the image, which I then have to either print from another application, or reimport to Aperture to print. I was hoping to find something that will either just apply the border to the print job, or that would serve as more of an Edit With . . . type of plug-in than an Export plug-in, so I can keep everything in one place. Thanks again.
    Message was edited by: jeffd55

  • How to get rid of the black border around the artboard

    Hopefully my last question for tonight.
    I need to get rid of the black border around the artboard. The two images show my drawing lined up with the art board and then inside the artboard. The dark gray is not the artboard.
    As you see, the artboard has a black border. I need to get rid of it. It shows up in my project when my color key is green. The black won't go to transparent.
    So how-to get rid of the border? Thanks
    ***Update***
    I figured it out. View > Hide Artboards. Maybe this will help someone. Doesn't change the fact my spider looks like a tick:)

    Doesn't change the fact my spider looks like a tick:)
    Try to get hold of a real spider and take a look at its anatomy, specially where the legs sprout from :-)

  • How to add a Border around an ImageView

    Hi all,
    I'm adding a row of photos in my application which are being resized to fit into some constrained space with Preserve Ratio true. They are put in a TilePane, with a Label below each photo.
    Basically, I give all my ImageViews a fitHeight of 120 pixels, and let them determine how wide they will become themselves in order to preserve the ratio.
    It looks great.
    However, I would like to add a Border around these images, as they sometimes fade too much into the background to clearly see the edges. ImageViews themselves donot support borders, so I'm forced to wrap these ImageViews inside another container.... but, no matter what container I use, the container itself refuses to resize itself to fit exactly around the image -- it seems to be completely oblivious of the real size of the Image -- with some parameters the ImageView will simply render itself outside the edges of its container, and with other parameters the container is wider than the ImageView leaving a gap on the right side.
    This is yet another instance where I want my ImageViews to resize themselves to fit the available space, resulting in a huge struggle to force these components into their proper straight-jacket. Anyone got any solutions for this?

    I'm afraid that also won't work, as the Image needs to be scaled, and the dimensions you are using are from the unscaled image.
    I've however am now using this class to get what I want, together with a stylesheet to specify the border it works and I get nice borders.
    package hs.mediasystem.util;
    import javafx.beans.property.BooleanProperty;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.geometry.Bounds;
    import javafx.geometry.Insets;
    import javafx.geometry.Pos;
    import javafx.scene.Node;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.layout.Region;
    import javafx.scene.layout.StackPane;
    public class ScaledImageView extends Region {
      private final ImageView imageView = new ImageView();
      private final StackPane effectRegion = new StackPane();
      private final ObjectProperty<Pos> alignment = new SimpleObjectProperty<>(Pos.TOP_LEFT);
      public ObjectProperty<Pos> alignmentProperty() { return alignment; }
      public final Pos getAlignment() { return this.alignment.get(); }
      public final void setAlignment(Pos pos) { this.alignment.set(pos); }
      public ScaledImageView(Node placeHolder) {
        getChildren().add(imageView);
        getChildren().add(effectRegion);
        getStyleClass().add("scaled-image-view");
        effectRegion.getStyleClass().add("image-view");
        if(placeHolder != null) {
          effectRegion.getChildren().add(placeHolder);
          placeHolder.getStyleClass().add("place-holder");
          placeHolder.visibleProperty().bind(imageView.imageProperty().isNull());
      public ScaledImageView() {
        this(null);
      @Override
      protected void layoutChildren() {
        Insets insets = effectRegion.getInsets();
        double insetsWidth = insets.getLeft() + insets.getRight();
        double insetsHeight = insets.getTop() + insets.getBottom();
        imageView.setFitWidth(getWidth() - insetsWidth);
        imageView.setFitHeight(getHeight() - insetsHeight);
        layoutInArea(imageView, insets.getLeft(), insets.getTop(), getWidth() - insetsWidth, getHeight() - insetsHeight, 0, alignment.get().getHpos(), alignment.get().getVpos());
        Bounds bounds = imageView.getLayoutBounds();
        effectRegion.setMinWidth(bounds.getWidth() + insetsWidth);
        effectRegion.setMinHeight(bounds.getHeight() + insetsHeight);
        effectRegion.setMaxWidth(bounds.getWidth() + insetsWidth);
        effectRegion.setMaxHeight(bounds.getHeight() + insetsHeight);
        layoutInArea(effectRegion,  0, 0, getWidth(), getHeight(), 0, alignment.get().getHpos(), alignment.get().getVpos());
      @Override
      protected double computePrefWidth(double height) {
        return 0;
      @Override
      protected double computePrefHeight(double width) {
        return 0;
      public final ObjectProperty<Image> imageProperty() { return imageView.imageProperty(); }
      public final Image getImage() { return imageView.getImage(); }
      public final void setImage(Image image) { imageView.setImage(image); }
      public final BooleanProperty preserveRatioProperty() { return imageView.preserveRatioProperty(); }
      public final boolean isPreserveRatio() { return imageView.isPreserveRatio(); }
      public final void setPreserveRatio(boolean preserveRatio) { imageView.setPreserveRatio(preserveRatio); }
      public final BooleanProperty smoothProperty() { return imageView.smoothProperty(); }
      public final boolean isSmooth() { return imageView.isSmooth(); }
      public final void setSmooth(boolean smooth) { imageView.setSmooth(smooth); }
    }

  • Thin white border around image in browser

    In Firefox and Safari a thin white border appears around a
    black image. My background is black so.....is it a matter of the
    blacks being slightly different? I'd like the image to appear
    seamless on the page. How can I fix this?
    http://wall-eye.com/about.html
    (it's the Walleye eye navigation image)
    keith

    Hi, Even when you assign 100% to width and height you will notice one black border around applet in case of IE5.0 When I go in to full srceen mode in IE 5.0 It should not show me scrollbars.
    But because of this border scrollbar remains

  • How to make a round border around my picture?

    I am trying to design a logo that would fit into the center of a Frisbie, yet I cannot figure out how to make a round border around the picture. I have tried using the eliptical tool, and have also tried using the cookie cutter. The only option I can get to work with the eliptical tool, is the feather, yet I can't change the pixel number for some reason, so it just makes a thin circle around the picture. I thought I could cut and paste it, but the copy and cut options were grayed out and didn't work. When I used the cookie cutter, it made a nice border, and I pasted the picture into it, but, there are four sections that need to be filled in with the background color and the paintbucket didn't work in those spaces (they are the gray and white checked areas. (the picture ends up looking like a rectangle inside of a circle). So I made a new blank file and filled it in with the color of the picture's background, hoping to use the cookie cutter tool around the picture that was now pasted into the new blank file (I chose another color for the round border) and I used the cookie cutter around the picture, but when it was finished, the whole picture ended up being white. All I want to do is to make a border around a picture (a round border). Nothing I have done has worked though. What am I doing wrong, or what are some other options for trying to do this? Thanks.

    Here is a simple way to add a border. Select the item, add a blank layer, choose the border size and color and the Outside option:
    Here is the result:
    Note that you don't even need to do the Stroke on a blank layer. You can Stroke directly on the picture layer. However having the blank layer preserves the picture in case you want to start again with different Stroke options.
    If this is not what you are looking to do, please clarify.

Maybe you are looking for

  • Cancel customer down payment

    Dear Experts, Can you help me with the below issue, I have created a downpayment request through VF01 mistakenly , Now I wanted to cancel it, could you please let me know what I need to do 1.This DP request was created as a noted item now, 2.I cannot

  • Export/import oracle9

    Hi, since I do not have a good knowledge of oracle, hopefully somebody may help me to understand better how export/import work (oracle 9) A colleague as run an export from a production server, now he needs to run the import on a test server but it fa

  • Yosemite 10.10.3 upgrade problem on MacBook Pro

    Hi there, I upgraded my iMac 27" without any problem, apart from the fact that it took 12 hours to download and install the update.  All fine otherwise. My MacBook Pro 13" is another story.  I have tried to upgrade from 10.10.2 to 10.10.3 several tim

  • How can i store the messge  in local machine?

    Hello Sir, i am using the IMAP for receving and sending the mail. for that i am using the mail.jar and activation.jar. but i have also requirement to store the message in local machine. that's why i have to use POP3. i have to search about , for stor

  • How add a new icon in the title bar?

    does anyone know how to change the default "java icon" that appears on the title bar of a Window (in an application Frame)?