congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Container.getBackground
Code IndexAdd Tabnine to your IDE (free)

How to use
getBackground
method
in
java.awt.Container

Best Java code snippets using java.awt.Container.getBackground (Showing top 20 results out of 387)

origin: winder/Universal-G-Code-Sender

@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
  Graphics2D g2d = (Graphics2D) g;
  g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  RoundRectangle2D.Double rectangle = new RoundRectangle2D.Double(x, y, width - 1, height - 1, radius, radius);
  Area rectangleArea = new Area(rectangle);
  Area area = new Area(new Rectangle(0, 0, width, height));
  area.subtract(rectangleArea);
  g2d.setClip(area);
  g2d.setColor(c.getParent().getBackground());
  g2d.fillRect(0, 0, width, height);
  g2d.setClip(null);
  if (color == null) {
    g2d.setColor(c.getBackground());
  } else {
    g2d.setColor(color);
  }
  g2d.setStroke(stroke);
  g2d.draw(rectangleArea);
}
origin: ron190/jsql-injection

Container parent = c.getParent();
if (parent!=null) {
  g2.setColor(parent.getBackground());
  Area corner = new Area(new Rectangle2D.Float(x, y, width, height));
  corner.subtract(new Area(round));
origin: stackoverflow.com

...
 Container container = getContentPane();
 container.setBackground(new Color(240,240,240));
 ...
 nonEditableTextField.setBackground(container.getBackground());
 ...
origin: org.japura/japura-gui

@Override
public Color getBackground() {
 return root.getContentPane().getBackground();
}
origin: leMaik/swing-material

/**
 * Paints this effect.
 * @param g canvas
 */
public void paint(Graphics g) {
  Graphics2D g2 = (Graphics2D) g;
  g2.setBackground(target.getParent().getBackground());
  g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
  g.drawImage(shadow.render(target.getWidth(), target.getHeight(), borderRadius, level.getValue(), MaterialShadow.Type.SQUARE), 0, 0, null);
}
origin: freeplane/freeplane

  @Override
  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
      int row, int column) {
    final Component c = delegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    final Container mapView = SwingUtilities.getAncestorOfClass(MapView.class, table);
    if(mapView != null)
      c.setBackground(mapView.getBackground());
    final int height = (int) (((AttributeTable)table).getZoom() * 6);
    final Dimension preferredSize = new Dimension(1, height);
    c.setPreferredSize(preferredSize);
    return c;
  }
}
origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Overriden to paint the background of the component but keeping the rounded
 * corners.
 */
@Override
public void update(Graphics g, JComponent c) {
 if (c.isOpaque()) {
  g.setColor(c.getParent().getBackground());
  g.fillRect(0, 0, c.getWidth(), c.getHeight());
  g.setColor(c.getBackground());
  g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight() - getRoundHeight());
 }
 paint(g, c);
}
origin: org.codehaus.jtstand/jtstand-desktop

/**
 * Overriden to paint the background of the component but keeping the rounded
 * corners.
 */
public void update(Graphics g, JComponent c) {
 if (c.isOpaque()) {
  g.setColor(c.getParent().getBackground());
  g.fillRect(0, 0, c.getWidth(), c.getHeight());
  g.setColor(c.getBackground());
  g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight() - getRoundHeight());
 }
 paint(g, c);
}
origin: org.codehaus.jtstand/jtstand-desktop

/**
 * Overriden to paint the background of the component but keeping the rounded
 * corners.
 */
public void update(Graphics g, JComponent c) {
 if (c.isOpaque()) {
  g.setColor(c.getParent().getBackground());
  g.fillRect(0, 0, c.getWidth(), c.getHeight());
  g.setColor(c.getBackground());
  g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight() - getRoundHeight());
 }
 paint(g, c);
}
origin: org.gosu-lang.gosu/gosu-lab

public void mouseExited( MouseEvent e )
{
 setBackground( _bkColor != null ? _bkColor : getParent().getBackground() );
}
origin: org.swinglabs.swingx/swingx-all

/**
 * Overriden to paint the background of the component but keeping the rounded
 * corners.
 */
@Override
public void update(Graphics g, JComponent c) {
 if (c.isOpaque()) {
  g.setColor(c.getParent().getBackground());
  g.fillRect(0, 0, c.getWidth(), c.getHeight());
  g.setColor(c.getBackground());
  g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight() - getRoundHeight());
 }
 paint(g, c);
}
origin: org.netbeans.modules/org-netbeans-modules-vmd-game

/** Creates new form ResourceImageEditor */
public ResourceImageEditor() {
  initComponents();
  this.getAccessibleContext().setAccessibleName(NbBundle.getMessage(ResourceImageEditor.class, "ResourceImageEditor.accessible.name"));
  this.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ResourceImageEditor.class, "ResourceImageEditor.accessible.description"));
  
  this.textFieldImage.setBackground(this.textFieldImage.getParent().getBackground());
  this.textFieldNumTiles.setBackground(this.textFieldNumTiles.getParent().getBackground());
  this.textFieldSize.setBackground(this.textFieldSize.getParent().getBackground());
  this.resourceComponent = new ResourceImageList();
  this.panelResourceList.add(new JScrollPane(this.resourceComponent));
}

origin: org.gosu-lang.gosu/gosu-lab

@Override
public void addNotify()
{
 super.addNotify();
 setBackground( getParent().getBackground() );
}
origin: org.gosu-lang.gosu/gosu-lab

@Override
public void addNotify()
{
 super.addNotify();
 setBackground( getParent().getBackground() );
}
origin: org.gosu-lang.gosu/gosu-lab

@Override
public void addNotify()
{
 super.addNotify();
 setBackground( getParent().getBackground() );
}
origin: eu.mihosoft.vrl/vrl

/**
 * If mouse leaves the transferable set its parent color mode to inactive,
 * i.e., display it with the color as defined by
 * <code>setInactiveColor()</code>
 *
 * @param mouseEvent the mouse event
 */
@Override
public void mouseExited(MouseEvent mouseEvent) {
  Connector i = (Connector) getParent();
  i.setBackground(this.getParent().getParent().getBackground());
  i.setSelected(false);
}
origin: org.gosu-lang.gosu/gosu-lab

public void mouseExited( MouseEvent e )
{
 setBorderPainted( isBorderConstant() );
 setBackground( _bkColor != null ? _bkColor : getParent().getBackground() );
}
origin: org.fudaa.framework.ctulu/ctulu-bu

protected void drawSingleLine(Graphics _g, String _s, int _x, int _y, int _w)
{
 Color bg=getBackground();
 if(!isOpaque())
 {
  Container p=getParent();
  if(p!=null) bg=p.getBackground();
 }
 BuFontChooser.drawStringWithStyle
  (_g,_s,_x,_y,style_|(isUnderlined() ? BuFontChooser.UNDERLINED : 0),bg);
 //_g.drawString(_s,_x,_y);
 //if(isUnderlined()) _g.drawLine(_x,_y+2,_x+_w-1,_y+2);
}
origin: org.softsmithy.lib/softsmithy-lib-swing

@Override
public Color getBackground() {
  return getStyleable().getParent() != null ? getStyleable().getParent().getBackground()
      : getStyleable().getNoneStyle().getBackground();
}
origin: org.softsmithy.lib/lib-core

public Color getBackground() {
 return getStyleable().getParent() != null ? getStyleable().getParent().getBackground() :
  getStyleable().getNoneStyle().getBackground();
}

java.awtContainergetBackground

Popular methods of Container

  • add
    Adds the specified component to this container. This is a convenience method for #addImpl. This meth
  • setLayout
    Sets the layout manager for this container.
  • getComponents
    Gets all the components in this container.
  • getComponent
    Gets the nth component in this container.
  • getParent
  • getComponentCount
    Gets the number of components in this panel.
  • remove
    Removes the specified component from this container.
  • getWidth
  • getInsets
    Determines the insets of this container, which indicate the size of the container's border. A Frame
  • getSize
  • getHeight
  • repaint
  • getHeight,
  • repaint,
  • setBackground,
  • getLayout,
  • validate,
  • getTreeLock,
  • removeAll,
  • getPreferredSize,
  • getBounds

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Permission (java.security)
    Legacy security code; do not use.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now