Click here to Skip to main content
16,006,355 members
Home / Discussions / Java
   

Java

 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994515-Jun-10 14:17
Member 211994515-Jun-10 14:17 
QuestionHow can I add Resources with jar file? Pin
002comp13-Jun-10 18:20
002comp13-Jun-10 18:20 
AnswerRe: How can I add Resources with jar file? (Solved) Pin
002comp13-Jun-10 18:50
002comp13-Jun-10 18:50 
QuestionSending of byte array messages to an VB Receiving Emulator application Pin
pohcb_sonic10-Jun-10 18:43
pohcb_sonic10-Jun-10 18:43 
AnswerRe: Sending of byte array messages to an VB Receiving Emulator application Pin
Richard MacCutchan10-Jun-10 23:15
mveRichard MacCutchan10-Jun-10 23:15 
GeneralRe: Sending of byte array messages to an VB Receiving Emulator application [modified] Pin
pohcb_sonic14-Jun-10 14:40
pohcb_sonic14-Jun-10 14:40 
GeneralRe: Sending of byte array messages to an VB Receiving Emulator application Pin
Richard MacCutchan15-Jun-10 4:48
mveRichard MacCutchan15-Jun-10 4:48 
QuestionHow to resizethe backGround Image to JPanel? Pin
002comp9-Jun-10 1:48
002comp9-Jun-10 1:48 
Hello Friends
I am adding a BackGround image to JPanel in two ways but It is not resizing according to JPanel.

First I added the Image to JLabel and then I added tht Label to Panel but after googling I found tht If we are adding through Label then only borderlayout take care of resizing and I tried all options of resizing but no use.

Then,Second I tried by creating a new class implements through JPanel.here is the code below:
class BackgroundPanel extends JPanel
{
  Image image;
  public BackgroundPanel()
  {
    try
    {
      image = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("c:\\Logo.jpg"), "Logo.jpg"));
    }
    catch (Exception e) { /*handled in paintComponent()*/ }
  }

  @Override
  protected void paintComponent(Graphics g)
  {
    super.paintComponent(g);
    if (image != null)
      g.drawImage(image, 0,0,this.getWidth(),this.getHeight(),this);
  }
}

With this method then i created the object like this
JPanel panel = new BackGroundPanel();
And added to ContentPane but with this method no Image is coming in background.

Any Ideas Please.
Thanks & Regards
Yogesh
AnswerRe: How to resizethe backGround Image to JPanel? Pin
David Skelly9-Jun-10 5:22
David Skelly9-Jun-10 5:22 
GeneralRe: How to resizethe backGround Image to JPanel? Pin
002comp9-Jun-10 17:52
002comp9-Jun-10 17:52 
GeneralRe: How to resizethe backGround Image to JPanel? Pin
David Skelly9-Jun-10 22:26
David Skelly9-Jun-10 22:26 
GeneralRe: How to resizethe backGround Image to JPanel? Pin
002comp10-Jun-10 1:05
002comp10-Jun-10 1:05 
QuestionDrop Down Pin
Wcmedic8-Jun-10 11:39
Wcmedic8-Jun-10 11:39 
AnswerRe: Drop Down Pin
Nagy Vilmos8-Jun-10 20:16
professionalNagy Vilmos8-Jun-10 20:16 
GeneralRe: Drop Down Pin
Wcmedic9-Jun-10 6:05
Wcmedic9-Jun-10 6:05 
GeneralStudent Report Program Pin
CodeScribbler7-Jun-10 20:45
CodeScribbler7-Jun-10 20:45 
GeneralRe: Student Report Program Pin
Richard MacCutchan7-Jun-10 21:47
mveRichard MacCutchan7-Jun-10 21:47 
GeneralStudent Report Program Pin
CodeScribbler7-Jun-10 22:46
CodeScribbler7-Jun-10 22:46 
GeneralRe: Student Report Program Pin
Richard MacCutchan8-Jun-10 3:42
mveRichard MacCutchan8-Jun-10 3:42 
GeneralRe: Student Report Program Pin
CodeScribbler9-Jun-10 3:34
CodeScribbler9-Jun-10 3:34 
GeneralRe: Student Report Program Pin
Richard MacCutchan9-Jun-10 4:29
mveRichard MacCutchan9-Jun-10 4:29 
QuestionHow to clone(Deep clone) instance variables in a class and it to the clone object of that class? Pin
PJanaki6-Jun-10 20:48
PJanaki6-Jun-10 20:48 
AnswerRe: How to clone(Deep clone) instance variables in a class and it to the clone object of that class? Pin
David Skelly6-Jun-10 22:24
David Skelly6-Jun-10 22:24 
GeneralRe: How to clone(Deep clone) instance variables in a class and it to the clone object of that class? Pin
PJanaki6-Jun-10 23:11
PJanaki6-Jun-10 23:11 
GeneralRe: How to clone(Deep clone) instance variables in a class and it to the clone object of that class? Pin
David Skelly7-Jun-10 2:41
David Skelly7-Jun-10 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.