Hello I'm trying to change one thing in my code and thats including an image in my background instead of simply a color. I put in the url inside of my code but it gives an error stating that I cant convert a color to string. what am I doing wrong here?  package blackjack; import javax.swing.*; import java.awt.*; import java.awt.event.*;  /**  *   * @author tacomeat  */ public class BlackjackGUI extends JFrame {  public static void main( String [] args ) {     JFrame frame = new BlackjackGUI();     frame.getContentPane().setBackground( FOREST_GREEN );             frame.setSize( 580, 480 );     frame.show(); }  private BlackjackDealer dealer; private GUIPlayer       human; private final JPanel players = new JPanel( new GridLayout( 0, 1 ) ); private static PlayerView Dealerview;  private static final Color FOREST_GREEN = new Color( 35, 142, 35 );  public BlackjackGUI() {       setUp();     WindowAdapter wa = new WindowAdapter() {         @Override         public void windowClosing( WindowEvent e ) {             System.exit( 0 );         }     };     addWindowListener( wa ); }  // needs to be protected if subclassed private PlayerView getPlayerView( Player p ) {     PlayerView v = new PlayerView( p );     v.setBackground( FOREST_GREEN );     return v; }     // needs to be protected if subclassed private void setUp() {     BlackjackDealer dealer = getDealer();     PlayerView v1 = getPlayerView( dealer );     this.Dealerview = v1;      GUIPlayer human = getHuman();     PlayerView v2 = getPlayerView( human );      PlayerView [] views = { v1, v2 };     addPlayers( views );      dealer.addPlayer( human );      addOptionView( human, dealer ); }  public PlayerView getDealerView(){     return this.Dealerview; }   // needs to be protected if subclassed private void addPlayers( PlayerView [] p ) {             players.setBackground( FOREST_GREEN );     for (PlayerView p1 : p) {         players.add(p1);     }       getContentPane().add( players, BorderLayout.CENTER );         }  private void addOptionView( GUIPlayer human, BlackjackDealer dealer ) {     OptionView ov = new OptionView( human, dealer );     ov.setBackground( FOREST_GREEN );     getContentPane().add( ov, BorderLayout.SOUTH ); }  private BlackjackDealer getDealer() {     if( dealer == null ) {         Hand dealer_hand = new Hand();         Deckpile cards = getCards();         dealer = new BlackjackDealer( "Dealer", dealer_hand, cards );     }     return dealer; }  private GUIPlayer getHuman() {     if( human == null ) {         Hand human_hand = new Hand();         Bank bank = new Bank( 1000 );         human = new GUIPlayer( "Human", human_hand, bank );     }     return human; }  private Deckpile getCards() {     Deckpile cards = new Deckpile();     for( int i = 0; i &lt; 4; i ++ ) {         cards.shuffle();         Deck deck = new VDeck();         deck.addToStack( cards );         cards.shuffle();     }     return cards; }  }
I have a  to which I'd like to add JPEG and PNG images that I generate on the fly.  All the examples I've seen so far in the , specially in the  use ImageIcons.  I'm generating these images as byte arrays, and they are usually larger than the common icon they use in the examples, at 640x480.   Is there any (performance or other) problem in using the ImageIcon class to display an image that size in a JPanel? What's the usual way of doing it? How to add an image to a JPanel without using the ImageIcon class?   Edit: A more careful examination of the tutorials and the API shows that you cannot add an ImageIcon directly to a JPanel. Instead, they achieve the same effect by setting the image as an icon of a JLabel. This just doesn't feel right...
Rules for forming demonyms Are there specific rules / conventions at play when creating demonyms? Or are they merely formed organically over time - the most popular winning out?  There are many suffixes to choose from, but I cannot find concrete guidelines as to which is proper to use in which instance. Convert a line drawing from raster to vector I have a raster image, basically a scanned drawing of the outlines (and some detail) of various objects, and I wish to convert these lines to vectors, using either Illustrator or Inkscape.  My present solution is to have the raster image as a background layer, and in a new layer above it I use the pen to follow the lines as close as possible.  Later I tweak these lines to fit the raster image better. That has worked fine for simple drawings. However for some of my extremely complex drawings, this is very tedious to do.  Is there any tool or filter of some sort that is capable of recognizing the lines in line drawings and creating vector paths from them? Update to latest version of java after ppa is discontinued Difference of the \dots* Templated check for the existence of a class member function? Is it possible to write a template that changes behavior depending on if a certain member function is defined on a class?  Here's a simple example of what I would want to write:  template&lt;class T&gt; std::string optionalToString(T* obj) {     if (FUNCTION_EXISTS(T-&gt;toString))         return obj-&gt;toString();     else         return "toString not defined"; }   So, if class T has toString() defined, then it uses it; otherwise, it doesn't. The magical part that I don't know how to do is the "FUNCTION_EXISTS" part. What lens focal length most closely resembles the perspective of the human eye? Is there any difference between Present Perfect and Present Perfect Continuous? I have studied "present perfect" and "present perfect continuous" for a week. I know forms, verb and helping verb I should use when I write them.  For me, they have nearly same definition because I can use them interchangeably in Thai language. (My native language)  For example, the sentences        I have learned English language in the past few weeks.    I have been learning English language in the past few weeks.       have no difference in meaning to me. They both mean "I began learning the English language in the past and I am still learning it"  Can I use them interchangeably in English? Or is there any difference between them? For example, when should I use present perfect but not present perfect continuous? Order of an element in a finite cyclic group Until now, I have been compiling my LaTeX documents with pdfLaTeX. My standard document preamble includes the "usual suspects" for non-English speakers (, , ) and a bunch of other packages. Assuming I were to convert to XeLaTeX, what modifications of my preamble are advisable? I'm aware that the expansion=true option of the  package is not (yet) available for XeLaTeX, and that  is sort of a default package for OpenType fonts. What other packages (and package options) should be removed and, vice versa, incorporated when switching from pdfLaTeX to XeLaTeX? Let $S = \{ax + by: x,y \in \mathbb{Z}\}$  and let $e &gt; 0$ be the smallest element in $S$. Prove that $e \mid a$, and hence prove that $e = \gcd(a,b)$  I'm afraid I can't provide much of my initial working here because I'm at a loss of how to start.  I suppose that to show $e\mid a$ I would have to show that $eg = a$ for some $g \in \mathbb{Z}$. But I have no idea how I would do this. home socket with DC voltage I'm wondering why, in a standard house, instead of using many low power AC-DC rectifier, there isn't a big (like 12V 20~50A) AC-DC rectifier which supplies some wall socket with a DC voltage? In the long run this should be less expensive, given the fact that AC to DC in one big apparatus is done better than in many low-quality transformers, right?  Also, modern chip DC voltage regulators have efficiency of >90%, so smaller (or even larger) voltages are still efficient and possible.  So we could use a 12V socket to charge a phone, desktop computer, laptop, radio etc... and still have an AC socket to move washing machine engine and other things that work better with an AC supply.  Why isn't this done?  edit: real question is: is it convenient, given a standard family (2 laptop, 1 desktop, 4 smarthpone, 1 big tv and some minor electonic) to do so? Where to find cross section data for $e^{-}$ + $p$ $\longrightarrow$ $p$ + $e^{-}$? Where to find cross section data for $e^{-}$ + $p$ $\longrightarrow$  $p$ + $e^{-}$ ?  does not include it. Solving 4 Quadratic Simultaneous Equations Consider the equations:   $$\begin{cases} ab+c+d=3\\ bc+d+a=5\\ cd+a+b=2\\ da+c+b=6 \end{cases}$$   Where $a,b,c,d \in \mathbb{R}$. How can we find $a,b,c,d$?   The furthest I've got is by adding the first two equations and the last two equations together to get: $ab+bc+c+d+d+a=(b+1)(a+c)+2d=8$ and $(d+1)(a+c)+2b=8$ We can rearrange these (assuming $b,d \neq -1$) to get $$\frac{8-2d}{b+1}=\frac{8-2b}{d+1} \implies -d^{2}+3d+4=-b^{2}+3b+4$$ Which leads us further to $$b^{2}-d^{2}-3(b-d)=0 \implies (b-d)(b+d-3)=0$$ Now since $b=d$ gives us an absurdity (equations 1 and 4 reduce to 3=6), we must have $b+d=3$. This is as far as I can get unfortunately, since trying the same approach with the other pairs doesn't work in the same way.  Help would be much appreciated; the problem is from the BMO1 2004 paper. What does ` (backquote/backtick) mean in commands? I came across the following command:  sudo chown `id -u` /somedir   and I wonder: what is the meaning of the ` symbol. I noticed for instance that while the command above works well, the one below does not:  sudo chown 'id -u' /somedir Problem with option border of class standalone I tested a MWE given in question . Following the documentation (page 9) I used the class option border={left right bottom top} with left=right=top=0pt and bottom=20pt (20pt only to show the effect here).  With the version 2012/09/15 v1.1b of standalone and the following MWE I get no 20 pt margin at the bottom of my picture.  What is the problem?  MWE:  \documentclass[% % border=1pt   border={0pt 0pt 20pt 0pt} %left right bottom top ]{standalone}% http://ctan.org/pkg/standalone \begin{document} $2^5 = x_5 \times y^8$ \end{document} How can I find unanswered questions with zero answers in some tag? Would fewer Jedi be more powerful? Yesterday I read Modern English:A Practical Reference Guide written by Marcella Frank, and she gives a paradigm about tenses on page 50. The page shows tenses in active voice and passive voice; she said these four tenses are exceedingly rare:   shall/will be being offered has/have been being offered had been being offered shall/will have been being offered   Why are these tense so rare? Are they normally replaced by other tenses? How to convert light activated switch What equipment and settings do I use for panning shots of moving objects? How do you go about getting great panning shots of things like cars and bicycles so that the background is nice and blurred but the target is sharp as can be. I have tried on many occasion to do panning shots and I just can't get the setup right.  What lens setup, shutter speed would be a good place to start?