Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I use up every pixel of the screen?

Status
Not open for further replies.

prosper

Programmer
Sep 4, 2001
631
HK
The following is my code and I found there is a grey line at the top and on the left of the applet.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.util.*;
import java.text.*;
import java.net.*;
import java.io.*;
import java.lang.*;

public class Draw extends Applet implements MouseListener
{
private Panel ScrPanel;
public void init()
{
ScrPanel = new Panel();
ScrPanel.setBounds(new Rectangle(0,0,400,400));
ScrPanel.setBackground(Color.red);
this.setLayout(null);
this.add(ScrPanel);
ScrPanel.addMouseListener(this);
}
public void mouseClicked(MouseEvent e)
{
}
public void mousePressed(MouseEvent e)
{
ScrPanel.setBackground(Color.white);
}
public void mouseReleased(MouseEvent e)
{
ScrPanel.setBackground(Color.black);
System.out.println("hello");
}
public void mouseEntered(MouseEvent e)
{
}
public void mouseExited(MouseEvent e)
{
}
public void paint(Graphics g)
{
}
}
 
Interesting. Do you still get the lines if you try a different browser or applet viewer?
It might be that the html pager in which your applet display is specifying that the applet is positioned at co-ordinate (1,1)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top