ScrollPane in Netscape
Hi,
I have a Java Applet with a scrollpane. There is a panel inside this scrollpane. The scroll bars work fine when I open the netscape browser for the first time. But when I reload the same page, although the bars appear but they don't move on mouse clicks.( I can scroll vertically using the middle mouse button only). But this applet works fine in IE.
Any help/suggestions would be greatly appreciated.
Thanks
most Browsers run java pretty badly
there is what happened when i tried to find a browser that could handle my app:
iCab doesn't stop firing keypressed events that were not pressed ( ??? )
Explorer works fine but takes 2 minutes to load what others load in 5 seconds
Netscape didn't open it at all
Safari worked just fine but is mac only ( apple really does great efforts to support java )
that's all
if the bug doesn't appear if you launch the applet in an applet viewer rather than in a browser then i don,t think there's much to do
sorry
Similar Messages
-
Netscape and SSO to partner application
Help!
I have a partner Java app using SSO with a custom login form. All is well in IE 6 but I get problems with Netscape 7.
It authenticates to the Portal OK, but not to the partner app.
The browser displays the following message:
Oracle SSO Failure - Unable to process request
Either the requested URL was not specified in terms of a fully-qualified host name or OHS single sign-on is incorrectly configured.
In the http server error log is the message:
[OSSO] W05: Requested URL is not specified in terms of fully-qualified host name or invalid SSO partner configuration. Host from request kwudeal2.nkw.ac.uk:80, registered host kwudeal2.nkw.ac.uk.
The obvious difference in the host names is the port 80, which is the correct port, but it wasn't in the URL I followed, Netscape appears to have added it.
Any ideas about what is going on and how to fix it?
Is anyone using Netscape 7 with SSO?
Thanks. RobHere's a DIY answer.
See Metalink Note 269820.1 which shows you how to use Perl to overwrite the host name in the HTTP header and remove the port number. -
When starting Netscape Calendar Server, the following error message appears:
<BR><P>
Module: , Label: 355, Service error: #0x13209
<P>
The three ACIs listed below need to be present in the Directory Server in order
for Calendar server to work properly. Check the properties on the Base DN to
verify that the following ACIs exist. If they are not present, you will need
to add them, and the Base DN will need to be modified for your enviroment.
<P>
<OL>
<LI>ACI for allowing users to modify their own entries.<BR>
<P>
(targetattr = "*")(version 3.0; acl "Allow self entry modification";
allow (write)userdn = "ldap:///self";)<BR>
<P>
<LI>ACI for allowing anyone permissions to Read, Search, and Compare.<BR>
<P>
(target="ldap:///o=basedn.com") (targetattr != "userPassword") (version
3.0; acl "Anonymous access";
allow (read, search, compare) userdn = "ldap:///anyone";)<BR>
<P>
<LI>ACI for allowing Calendar Server admins Write access to the Base DN
(this is necessary in order for admins to add users and resources to the node).
<BR><P>
(target="ldap:///o=basedn.com") (targetattr = "*") (version 3.0; acl
"Calendar Administrators Group";<BR>
allow(all) groupdn = "ldap:///cn=Calendar Server Admins,ou=Netscape
Servers,o=basedn.com";)<BR>
</OL>Hi Trinidad,
Thanks for your help!!!
1.
I didn't install EventSender and DIProxy yet, I tried first to upload and deploy the zip files, but I couldn't open the Itegration Application Explorer.
2.
The jvm.dll file is in in the folder pointed by the logs: C:\Program Files (x86)\SAP\SAP Business One Integration\jdk1.5.0_xx_sap\jre\bin\server
and it is also in C:\Program Files (x86)\SAP\SAP Business One Integration\jdk1.5.0_xx_sap_64\jre\bin\server
I tried running the file java5w.exe, but I got an error message:
Access is denied
Unable to open the service tomcat5
Thne I managed to open it by "rua as administrator".
the Java Virtual Machine path is points to the java 1.5 version folder.
Is it possible that the reason that the service can't start is related to administrator rigts??
In the properties in the Integration Service (services.msc):
It is set to be run with the local system account.
all other properties looks fine.
in the properties of the tomcat5.exe (and tomcat5w.exe , I tried both)
In the Compatibility tab I tried setting the flag "Run this program in compatibility mode for" to Vista, windows 7, and server 2008
I didn't have the option of Windows XP.
I have also set the Privilege level of: "Run this program as administrator" to true.
But still the service won't start.
What can be the problem?
What else can I check?
Thanks a lot,
Chana -
Custom graphics in java.awt.ScrollPane
Hi all,
I have to draw a custom created image in a scroll pane. As the image is very large I want to display it in a scroll pane. As parts of the image may change within seconds, and drawing the whole image is very time consuming (several seconds) I want to draw only the part of the image that is currently visible to the user.
My idea: creating a new class that extends from java.awt.ScrollPane, overwrite the paint(Graphics) method and do the drawings inside. Unfortunately, it does not work. The background of the scoll pane is blue, but it does not show the red box (the current viewport is not shown in red).
Below please find the source code that I am using:
package graphics;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.ScrollPane;
import java.awt.event.AdjustmentEvent;
public class CMyComponent extends ScrollPane {
/** <p>Listener to force a component to repaint when a scroll bar changes its
* position.</p>
private final class ScrollBarAdjustmentListener implements java.awt.event.AdjustmentListener {
/** <p>The component to force to repaint.</p> */
private final Component m_Target;
/** <p>Default constructor.</p>
* @param Target The component to force to repaint.
private ScrollBarAdjustmentListener(Component Target) { m_Target = Target; }
/** <p>Forces to component to repaint upon adjustment of the scroll bar.</p>
* @see java.awt.event.AdjustmentListener#adjustmentValueChanged(java.awt.event.AdjustmentEvent)
public void adjustmentValueChanged(AdjustmentEvent e) { m_Target.paint(m_Target.getGraphics()); }
public CMyComponent() {
// Ensure that the component repaints upon changing of the scroll bars
ScrollBarAdjustmentListener sbal = new ScrollBarAdjustmentListener(this);
getHAdjustable().addAdjustmentListener(sbal);
getVAdjustable().addAdjustmentListener(sbal);
public void paint(Graphics g) {
setBackground(Color.BLUE);
g.setColor(Color.RED);
g.fillRect(getScrollPosition().x, getScrollPosition().y, getViewportSize().width, getViewportSize().height);
public final static void main(String[] args) {
java.awt.Frame f = new java.awt.Frame();
f.add(new CMyComponent());
f.pack();
f.setVisible(true);
}Dear all,
I used the last days and tried several things. I think now I have a quite good working solution (just one bug remains) and it is very performant. To give others a chance to see what I have done I post the source code of the main class (a canvas drawing and implementing scrolling) here. As soon as the sourceforge project is accepted, I will publish the whole sources at there. Enjoy. And if you have some idea for my last bug in getElementAtPixel(Point), then please tell me.
package internetrail.graphics.hexgrid;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.geom.Area;
import java.awt.image.BufferedImage;
import java.util.WeakHashMap;
import java.util.Map;
/** <p>Hex grid view.</p>
* <p>Visualizes a {@link IHexGridModel}.</p>
* @version 0.1, 03.06.2006
* @author Bjoern Wuest, Germany
public final class CHexGridView extends Canvas implements ComponentListener, IHexGridElementListener {
/** <p>Serial version unique identifier.</p> */
private static final long serialVersionUID = -965902826101261530L;
/** <p>Instance-constant parameter for the width of a hex grid element.</p> */
public final int CONST_Width;
/** <p>Instance-constant parameter for 1/4 of the width of a hex grid element.</p> */
public final int CONST_Width1fourth;
/** <p>Instance-constant parameter for 3/4 of the width of a hex grid element.</p> */
public final int CONST_Width3fourth;
/** <p>Instance-constant parameter for 1.5 times of the width of a hex grid element.</p> */
public final int CONST_Width1dot5;
/** <p>Instance-constant parameter for 4 times of the width of a hex grid element.</p> */
public final int CONST_Widthquad;
/** <p>Instance-constant parameter for the height of a hex grid element.</p> */
public final int CONST_Height;
/** <p>Instance-constant parameter for 1/2 of the height of a hex grid element.</p> */
public final int CONST_Heighthalf;
/** <p>Instance-constant parameter for the double height of a hex grid element.</p> */
public final int CONST_Heightdouble;
/** <p>The steepness of a side of the hex grid element (calculated for the upper left arc).</p> */
public final double CONST_Steepness;
/** <p>The model of this hex grid </p> */
private final IHexGridModel m_Model;
/** <p>A cache for already created images of the hex map.</p> */
private final Map<Point, Image> m_Cache = new WeakHashMap<Point, Image>();
/** <p>The graphical area to draw the selection ring around a hex element.</p> */
private final Area m_SelectionRing;
/** <p>The image of the selection ring around a hex element.</p> */
private final BufferedImage m_SelectionRingImage;
/** <p>The current position of the hex grid in pixels (top left visible corner).</p> */
private Point m_ScrollPosition = new Point(0, 0);
/** <p>Flag to define if a grid is shown ({@code true}) or not ({@code false}).</p> */
private boolean m_ShowGrid = true;
/** <p>Flag to define if the selected hex grid element should be highlighted ({@code true}) or not ({@code false}).</p> */
private boolean m_ShowSelected = true;
/** <p>The offset of hex grid elements shown on the screen, measured in hex grid elements.</p> */
private Point m_CurrentOffset = new Point(0, 0);
/** <p>The offset of the image shown on the screen, measured in pixels.</p> */
private Point m_PixelOffset = new Point(0, 0);
/** <p>The index of the currently selected hex grid element.</p> */
private Point m_CurrentSelected = new Point(0, 0);
/** <p>The width of a buffered pre-calculated image in pixel.</p> */
private int m_ImageWidth;
/** <p>The height of a buffered pre-calculated image in pixel.</p> */
private int m_ImageHeight;
/** <p>The maximum number of columns of hex grid elements to be shown at once on the screen.</p> */
private int m_MaxColumn;
/** <p>The maximum number of rows of hex grid elements to be shown at once on the screen.</p> */
private int m_MaxRow;
/** <p>Create a new hex grid view.</p>
* <p>The hex grid view is bound to a {@link IHexGridModel} and registers at
* that model to listen for {@link IHexGridElement} updates.</p>
* @param Model The model backing this view.
public CHexGridView(IHexGridModel Model) {
// Set the model
m_Model = Model;
CONST_Width = m_Model.getElementsWidth();
CONST_Height = m_Model.getElementsHeight();
CONST_Width1fourth = CONST_Width/4;
CONST_Width3fourth = CONST_Width*3/4;
CONST_Width1dot5 = CONST_Width*3/2;
CONST_Heighthalf = CONST_Height/2;
CONST_Widthquad = CONST_Width*4;
CONST_Heightdouble = CONST_Height*2;
CONST_Steepness = (double)CONST_Heighthalf / CONST_Width1fourth;
m_ImageWidth = getSize().width+CONST_Widthquad;
m_ImageHeight = getSize().height+CONST_Heightdouble;
m_MaxColumn = m_ImageWidth / CONST_Width3fourth;
m_MaxRow = m_ImageHeight / CONST_Height;
// Register this canvas for various notifications
m_Model.addElementListener(this);
addComponentListener(this);
// Create the selection ring to highlight hex grid elements
m_SelectionRing = new Area(new Polygon(new int[]{-1, CONST_Width1fourth-1, CONST_Width3fourth+1, CONST_Width+1, CONST_Width3fourth+1, CONST_Width1fourth-1}, new int[]{CONST_Heighthalf, -1, -1, CONST_Heighthalf, CONST_Height+1, CONST_Height+1}, 6));
m_SelectionRing.subtract(new Area(new Polygon(new int[]{2, CONST_Width1fourth+2, CONST_Width3fourth-2, CONST_Width-2, CONST_Width3fourth-2, CONST_Width1fourth+2}, new int[]{CONST_Heighthalf, 2, 2, CONST_Heighthalf, CONST_Height-2, CONST_Height-2}, 6)));
m_SelectionRingImage = new BufferedImage(CONST_Width, CONST_Height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = m_SelectionRingImage.createGraphics();
g.setColor(Color.WHITE);
g.fill(m_SelectionRing);
@Override public synchronized void paint(Graphics g2) {
// Caculate the offset of indexes to show
int offsetX = 2 * (m_ScrollPosition.x / CONST_Width1dot5) - 2;
int offsetY = (int)(Math.ceil(m_ScrollPosition.y / CONST_Height) - 1);
m_CurrentOffset = new Point(offsetX, offsetY);
// Check if the image is in the cache
Image drawing = m_Cache.get(m_CurrentOffset);
if (drawing == null) {
// The image is not cached, so draw it
drawing = new BufferedImage(m_ImageWidth, m_ImageHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = ((BufferedImage)drawing).createGraphics();
// Draw background
g.setColor(Color.BLACK);
g.fillRect(0, 0, m_ImageWidth, m_ImageHeight);
// Draw the hex grid
for (int column = 0; column <= m_MaxColumn; column += 2) {
for (int row = 0; row <= m_MaxRow; row++) {
// Draw even column
IHexGridElement element = m_Model.getElementAt(offsetX + column, offsetY + row);
if (element != null) { g.drawImage(element.getImage(m_ShowGrid), (int)(column*(CONST_Width3fourth-0.5)), CONST_Height*row, null); }
// Draw odd column
element = m_Model.getElementAt(offsetX + column+1, offsetY + row);
if (element!= null) { g.drawImage(element.getImage(m_ShowGrid), (int)(column*(CONST_Width3fourth-0.5)+CONST_Width3fourth), CONST_Heighthalf*(row*2+1), null); }
// Put the image into the cache
m_Cache.put(m_CurrentOffset, drawing);
// Calculate the position of the image to show
offsetX = CONST_Width1dot5 + (m_ScrollPosition.x % CONST_Width1dot5);
offsetY = CONST_Height + (m_ScrollPosition.y % CONST_Height);
m_PixelOffset = new Point(offsetX, offsetY);
g2.drawImage(drawing, -offsetX, -offsetY, null);
// If the selected element should he highlighted, then do so
if (m_ShowSelected) {
// Check if the selected element is on screen
if (isElementOnScreen(m_CurrentSelected)) {
// Correct vertical offset for odd columns
if ((m_CurrentSelected.x % 2 == 1)) { offsetY -= CONST_Heighthalf; }
// Draw the selection circle
g2.drawImage(m_SelectionRingImage, (m_CurrentSelected.x - m_CurrentOffset.x) * CONST_Width3fourth - offsetX - ((m_CurrentSelected.x + 1) / 2), (m_CurrentSelected.y - m_CurrentOffset.y) * CONST_Height - offsetY, null);
@Override public synchronized void update(Graphics g) { paint(g); }
public synchronized void componentResized(ComponentEvent e) {
// Upon resizing of the component, adjust several pre-calculated values
m_ImageWidth = getSize().width+CONST_Widthquad;
m_ImageHeight = getSize().height+CONST_Heightdouble;
m_MaxColumn = m_ImageWidth / CONST_Width3fourth;
m_MaxRow = m_ImageHeight / CONST_Height;
// And flush the cache
m_Cache.clear();
public void componentMoved(ComponentEvent e) { /* do nothing */ }
public void componentShown(ComponentEvent e) { /* do nothing */ }
public void componentHidden(ComponentEvent e) { /* do nothing */ }
public synchronized void elementUpdated(IHexGridElement Element) {
// Clear cache where the element may be contained at
for (Point p : m_Cache.keySet()) { if (isElementInScope(Element.getIndex(), p, new Point(p.x + m_MaxColumn, p.y + m_MaxRow))) { m_Cache.remove(p); } }
// Update the currently shown image if the update element is shown, too
if (isElementOnScreen(Element.getIndex())) { repaint(); }
/** <p>Returns the model visualized by this grid view.</p>
* @return The model visualized by this grid view.
public IHexGridModel getModel() { return m_Model; }
/** <p>Returns the current selected hex grid element.</p>
* @return The current selected hex grid element.
public IHexGridElement getSelected() { return m_Model.getElementAt(m_CurrentSelected.x, m_CurrentSelected.y); }
/** <p>Sets the current selected hex grid element by its index.</p>
* <p>If the selected hex grid element should be highlighted and is currently
* shown on the screen, then this method will {@link #repaint() redraw} this
* component automatically.</p>
* @param Index The index of the hex grid element to become the selected one.
* @throws IllegalArgumentException If the index refers to a non-existing hex
* grid element.
public synchronized void setSelected(Point Index) throws IllegalArgumentException {
// Check that the index is valid
if ((Index.x < 0) || (Index.y < 0) || (Index.x > m_Model.getXElements()) || (Index.y > m_Model.getYElements())) { throw new IllegalArgumentException("There is no hex grid element with such index."); }
m_CurrentSelected = Index;
// If the element is on screen and should be highlighted, then repaint
if (m_ShowSelected && isElementOnScreen(m_CurrentSelected)) { repaint(); }
/** <p>Moves the visible elements to the left by the number of pixels.</p>
* <p>To move the visible elements to the left by one hex grid element, pass
* {@link #CONST_Width3fourth} as the parameter. The component will
* automatically {@link #repaint()}.</p>
* @param Pixels The number of pixels to move to the left.
* @return The number of pixels moved to the left. This is always between 0
* and {@code abs(Pixels)}.
public synchronized int moveLeft(int Pixels) {
int delta = m_ScrollPosition.x - Math.max(0, m_ScrollPosition.x - Math.max(0, Pixels));
if (delta != 0) {
m_ScrollPosition.x -= delta;
repaint();
return delta;
/** <p>Moves the visible elements up by the number of pixels.</p>
* <p>To move the visible elements up by one hex grid element, pass {@link
* #CONST_Height} as the parameter. The component will automatically {@link
* #repaint()}.</p>
* @param Pixels The number of pixels to move up.
* @return The number of pixels moved up. This is always between 0 and {@code
* abs(Pixels)}.
public synchronized int moveUp(int Pixels) {
int delta = m_ScrollPosition.y - Math.max(0, m_ScrollPosition.y - Math.max(0, Pixels));
if (delta != 0) {
m_ScrollPosition.y -= delta;
repaint();
return delta;
/** <p>Moves the visible elements to the right by the number of pixels.</p>
* <p>To move the visible elements to the right by one hex grid element, pass
* {@link #CONST_Width3fourth} as the parameter. The component will
* automatically {@link #repaint()}.</p>
* @param Pixels The number of pixels to move to the right.
* @return The number of pixels moved to the right. This is always between 0
* and {@code abs(Pixels)}.
public synchronized int moveRight(int Pixels) {
int delta = Math.min(m_Model.getXElements() * CONST_Width3fourth + CONST_Width1fourth - getSize().width, m_ScrollPosition.x + Math.max(0, Pixels)) - m_ScrollPosition.x;
if (delta != 0) {
m_ScrollPosition.x += delta;
repaint();
return delta;
/** <p>Moves the visible elements down by the number of pixels.</p>
* <p>To move the visible elements down by one hex grid element, pass {@link
* #CONST_Height} as the parameter. The component will automatically {@link
* #repaint()}.</p>
* @param Pixels The number of pixels to move down.
* @return The number of pixels moved down. This is always between 0 and
* {@code abs(Pixels)}.
public synchronized int moveDown(int Pixels) {
int delta = Math.min(m_Model.getYElements() * CONST_Height + CONST_Heighthalf - getSize().height, m_ScrollPosition.y + Math.max(0, Pixels)) - m_ScrollPosition.y;
if (delta != 0) {
m_ScrollPosition.y += delta;
repaint();
return delta;
/** <p>Checks if the hex grid element of the given index is currently
* displayed on the screen (even just one pixel).</p>
* <p>The intention of this method is to check if a {@link #repaint()} is
* necessary or not.</p>
* @param ElementIndex The index of the element to check.
* @return {@code true} if the hex grid element of the given index is
* displayed on the screen, {@code false} if not.
public synchronized boolean isElementOnScreen(Point ElementIndex) { return isElementInScope(ElementIndex, m_CurrentOffset, new Point(m_CurrentOffset.x + m_MaxColumn, m_CurrentOffset.y + m_MaxRow)); }
/** <p>Checks if the hex grid element of the given index is within the given
* indexes.</p>
* <p>The intention of this method is to check if a {@link #repaint()} is
* necessary or not.</p>
* @param ElementIndex The index of the element to check.
* @param ReferenceIndexLeftTop The left top index of the area to check.
* @param ReferenceIndexRightBottom The right bottom index of the area to check.
* @return {@code true} if the hex grid element of the given index is within
* the given area, {@code false} if not.
public synchronized boolean isElementInScope(Point ElementIndex, Point ReferenceIndexLeftTop, Point ReferenceIndexRightBottom) { if ((ElementIndex.x >= ReferenceIndexLeftTop.x) && (ElementIndex.x <= ReferenceIndexRightBottom.x) && (ElementIndex.y >= ReferenceIndexLeftTop.y) && (ElementIndex.y <= (ReferenceIndexRightBottom.y))) { return true; } else { return false; } }
/** <p>Return the {@link IHexGridElement hex grid element} shown at the given
* pixel on the screen.</p>
* <p><b>Remark: There seems to be a bug in retrieving the proper element,
* propably caused by rounding errors and unprecise pixel calculations.</p>
* @param P The pixel on the screen.
* @return The {@link IHexGridElement hex grid element} shown at the pixel.
public synchronized IHexGridElement getElementAtPixel(Point P) {
// @FIXME Here seems to be some bugs remaining
int dummy = 0; // Variable for warning to indicate that there is something to do :)
// Calculate the pixel on the image, not on the screen
int px = P.x + m_PixelOffset.x;
int py = P.y + m_PixelOffset.y;
// Determine the x-index of the column (is maybe decreased by one)
int x = px / CONST_Width3fourth + m_CurrentOffset.x;
// If the column is odd, then shift the y-pixel by half element height
if ((x % 2) == 1) { py -= CONST_Heighthalf; }
// Determine the y-index of the row (is maybe decreased by one)
int y = py / CONST_Height + m_CurrentOffset.y;
// Normative coordinates to a single element
px -= (x - m_CurrentOffset.x) * CONST_Width3fourth;
py -= (y - m_CurrentOffset.y) * CONST_Height;
// Check if the normative pixel is in the first quarter of a column
if (px < CONST_Width1fourth) {
// Adjustments to the index may be necessary
if (py < CONST_Heighthalf) {
// We are in the upper half of a hex-element
double ty = CONST_Heighthalf - CONST_Steepness * px;
if (py < ty) { x--; }
} else {
// We are in the lower half of a hex-element
double ty = CONST_Heighthalf + CONST_Steepness * px;
if (py > ty) {
x--;
y++;
return m_Model.getElementAt(x, y);
}Ah, just to give you some idea: I use this component to visualize a hex grid map with more than 1 million grid elements. And it works, really fast, and requires less than 10 MByte of memory. -
Import netscape.ldap.* ; is it not supported in Sun one LDAP server
import netscape.ldap.*;
is the above line not supported n Sun One LDAP directory Server
if that is the case what should i do
wenever i compile my code the error tat comes up is : package netscap.ladp does not exists
need help immediately
my code is as follows
import netscape.ldap.*;
import java.util.*;
* Simple search program to experiment with filters
public class SearchFilter {
* Do a subtree search using a specified filter
* @parm args host, port, authDN, password, baseDN, filter
public static void main(String[] args) {
if (args.length != 6) {
System.out.println("Usage: java FilterSearch " + "<host> <port> " + "<authdn> <password> " + "<baseDN> <filter>");
System.out.println("Example:");
System.out.println(" java FilterSearch " + "localhost 389 " + "\"\" \"\" " + "\"o=airius.com\" " + "\"(|(cn=sam*)(cn=b*))\"");
System.exit(1);
}Couldn't you download the netscape.ldap package (iPlanet LDAP SDK) and put its jars in your app classpath?
The suggested way to replace netscape.ldap package is to use only JNDI calls, but maybe they can not fulfill all your needs.
By the way, you can get the source code for that package in Mozilla.org site.
(Note: if you are using Netscape LDAP SDK for parsing/generating ASN.1 streams including X.509 certificates, try using BouncyCastle instead of netscape.ldap.ber.stream package - I had to modify several classes from Netscape's package that is not meant to handle certificates, but LDAP streams...) -
How to set up a Java Plug-in Download page in case of netscape?
hai all of you,
i have a problem regarding downloading plugin.
i am using <object > and <embed> tags to download the plugins inorder to run the applets. but it is taking long time to download the plugin form sun.com.
so what i have done is, i downloaded the plugin.exe file and .cab file and put it in my tomcat server mainted by other party.(y application if for internet purpose only.)
i refered to http://java.sun.com/products/plugin/1.2/docs/intranet.html. there it is mentioned that, to download the plugin.
for I.E i can able to change the code.
but for NetScape it's a little bit confusing.
i have downloaded the binary file in my own directory.
here he is asking to set up a java plugin-in download page.
instead of this "plugin-install.html" page what page i should create and what should be the code in this page if i have to write on my own. please let me know if anybody know about it.
following para is from sun.com
"To deploy Java Plug-in in intranet environments with Navigator, you need to download and store the Java Plug-in binary file on one of your web servers. Then you need to set up a Java Plug-in Download page and modify the pluginspage attribute in the EMBED tag to refer to this page. The Download page should have options to download different versions of Java Plug-in, such as for Windows and Solaris. For example, if you have set up the Java Plug-in Download page at "http://javaweb.eng/plugin/" and the page is called plugin-install.html, you can specify the pluginspage as "http://javaweb.eng/plugin/plugin-install.html". "
thanks
by
sambareddyI have successfuly done this.
Change the converted html as per the instructions to point to another page.
Here is an example of the new html page you need to create:
<html>
<head>
<title>Java Plugin Install Page</title>
</head>
<body>
<h2><center>Java Plugin Install Page</center></h2>
<p></p>
<h3>Windows Version Only!!!</h3>
Click here to Download Plugin
<p></p>
<p>You may or may not be asked to either save or run from current location</p>
<p>If the run from current location is available, use that option</p>
<p>If you can only save the file, then save it to your workstation and exit the download page and exit Netscape. Then using Windows Explorer, go to where you downloaded the file and double click on the file to run it. Accept all options during the install process and once it has finished try accessing your web page again using Netscape. You should then get to the web page or application and this page will not apppear again.
</body>
</html>
If you put the file j2re-1_3_1-win.exe on a web server somewhere then you will have to prefix the file with
http://yourwebserverdirectory/
Hope this helps. -
Importing to Mac Mail Tiger 10.4.8 (intel xeon) From Netscape (7.2) mail.
I can import old mail from Netscape 7.2 into Mac Mail Tiger 10.4.8. And most old mail back from 2002-2004 is imported but starting around MARCH 2005, no more mail is imported. That is out of 10-15 folders imported INTO the "import folder" each new folder contains, older mail but only a few from 2005, and nothing from after march 2005. (perhaps when switched from NS 7.1 to 7.2?? don't know) But in any case viewing with NS mail shows the files and attachments, but they DO not import to Mack mail. (one oddity when viewed in NS mail, if the priority column to be "normal" then they are imported. If empty then not imported.)
Any ideas how to get the rest of this mail into Mac Mail?
thanks
-g
G5 Mac OS X (10.4.8) intel xeon 64-bitI simply DID NOT have the correctly dated BACKUP SET!
So NOW with all the data, properly in my Netscape Mail "local folders" I can easiliy (but slowly) convert them to Mac Mail.
Sorry for pulling the trigger too soon, It works perfectly if I use the proper backup data.
DUH! on me! -
Urgent Help Required !!!! For using Netscape to open Form on the Intranet
Hi ,
I am successfully able to open Form application in a seperate window using IE 5.0.
I would like to do the same with Netscape Navigator 4.7. The Navigator justshows a page which asks me to download the plugin and then even after I install the plugin it does the same thing over and over again.
Please help !!!!!
Regards,
Rinas<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Andrew Timpone ([email protected]):
Which version of the JInitiator are you using. In any case, your HTML must specify the correct classid and version in the HTML section for IE as well as the HTML section for Netscape.
Below is a sample for JInitiator 1.1.7.27 running forms v6.0
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="">
<title></title>
<!-- FILE: static.html -->
<!-- Oracle Static (Non-Cartridge) HTML File Template (Windows NT) -->
<!-- Rename, and modify tags and parameter values as needed -->
</head>
<body bgcolor="#FFFCE8">
<p><font size="1"><br>
<br>
<br>
</font></p>
<p align="center">
<object classid="clsid:093501ce-d290-11d3-a3d6-00c04fa32518"
codebase="<<your server and path of JInitiator Plug-in goes here>>jinit11727.exe#Version=1,1,7,27"
align="baseline" border="0" width="1024" height="786">
<PARAM NAME="CODE" value="oracle.forms.engine.Main">
<PARAM NAME="CODEBASE" value="/web_code/">
<PARAM NAME="ARCHIVE" value="/web_code/f60all.jar">
<PARAM NAME="type" value="application/x-jinit-applet;version=1.1.7.27">
<PARAM NAME="serverPort" value="4321">
<PARAM NAME="serverArgs" value="module=<<your form path and name goes here>>">
<PARAM NAME="serverApp" value="default">
<PARAM NAME="lookAndFeel" value="oracle">
<PARAM NAME="separateFrame" value="true">
<font size="1">
<COMMENT>
<embed align="baseline" border="0" width="800" height="600" type="application/x-jinit-applet;version=1.1.7.27"
java_code="oracle.forms.engine.Main"
java_codebase="/web_code/"
java_archive="/web_code/f60all.jar"
serverport="4321"
serverargs="module=<<your form path and name goes here>>"
serverapp="default"
pluginspage="<<your server and path of JInitiator Plug-in goes here>>"
colorscheme="Titanium"
lookAndFeel="oracle"
separateframe="true">
<NOEMBED>
</COMMENT>
</NOEMBED> </font></object><font size="1"> </font></p>
</body>
</html>
Below is a sample with JInitiator 1.1.5.21 with forms v5.0
<HTML>
<!-- FILE: static.html -->
<!-- Oracle Static (Non-Cartridge) HTML File Template (Windows NT) -->
<!-- Rename, and modify tags and parameter values as needed -->
<HEAD><TITLE></TITLE></HEAD>
<P>
<OBJECT classid="clsid:9F77a997-F0F3-11d1-9195-00C04FC990DC"
WIDTH=20
HEIGHT=20
codebase="<<your server name and path for JInitiator Plug-in goes here>>jinit115211.exe#Version=1,1,5,21">
<PARAM NAME="CODE" VALUE="oracle.forms.uiClient.v1_4.engine.Main" >
<PARAM NAME="CODEBASE" VALUE="/web_code/" >
<PARAM NAME="ARCHIVE" VALUE="/web_code/f50all.jar" >
<PARAM NAME="type" VALUE="application/x-jinit-applet;version=1.1.5.21">
<PARAM NAME="serverPort" VALUE="4321">
<PARAM NAME="serverArgs" VALUE="module=<<your form path and name goes here>>">
<PARAM NAME="serverApp" VALUE="default">
<COMMENT>
<EMBED type="application/x-jinit-applet;version=1.1.5.21"
java_CODE="oracle.forms.uiClient.v1_4.engine.Main"
java_CODEBASE="/web_code/"
java_ARCHIVE="/web_code/f50all.jar"
WIDTH=20
HEIGHT=20
serverPort="4321"
serverArgs="module=<<your form path and name goes here>>"
serverApp="default"
pluginspage="<<your server name and path for JInitiator Plug-in goes here>>">
<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>
</BODY>
</HTML>
Hi Andy,
Thanks a lot !!!
Its working perfectly fine now.
Regards,
Rinas
Hope this helps<HR></BLOCKQUOTE>
null -
Netscape 4.7 and duplicate cookies
I've got an application that works fine on IE and Netscape 6, but NS 4.7 is
giving me a headache. I'm trying to expire the cookies that I've originally
written with 1-year expiration date. I originally created the cookie like
this:
info = new Cookie("UserID", "Bob");
info.setMaxAge(60 * 60 * 24 * 365); // One year
info.setPath("/");
response.addCookie(info);
When I try to expire it using this:
info = Utilities.getCookie(request.getCookies(), "UserID"); // Gets the
cookie from the request structure
if (info != null)
info.setMaxAge(0);
response.addCookie(info);
it fails on Netscape (both versions); the cookie doesn't disappear, almost
like it ignored it. When I changed it to this:
info = Utilities.getCookie(request.getCookies(), "UserID"); // Gets
the cookie from the request structure
if (info != null)
info.setValue("0");
info.setMaxAge(3);
response.addCookie(info);
it works on Netscape 6 (the cookie is invalidated enough that the code works
and will expire in a few seconds). However, on Netscape 4.7, nothing
changes. So I did a little debugging and found that under NS 4.7, the
request structure ends up with TWO cookies of the same name ("UserID") and
two different values. The first being its original value and the second
being the value I set above. Clearly, something's not right. Is it me? Is
NS 4.7 just buggy? I'm stuck for an answer to this mystery.
Thanks in advance for help,
-- Andy.
Hi,
When using Micosoft's Internet Explorer web browser, version 5.0 is supported for end users only. For administrators, changes to the iPlanet Web Server Administration Server configuration can be saved only when using Internet Explorer version 5.5. with standard Encryption.
Thanx
Selva -
Design problem(split pane scrollpane Insets)
hi,
doing a exam simulator prgm
design is like,
Question (text area with scrollpane)
Answers (checkbox inside panel with scrollpane)
used split pane between qst and ans but big thick bar comes how to reduce size and it is not
moving.
used GridLayout for container and panel.
PROBLEM is how to leave space qst textarea appears from very left edge of screen how to leave some space
same prblm for checkbox they to appear extreme left on screen.Put those components in a JPanel overwriting the getInsets() method like this:
JPanel cPane=new JPanel(){
private final Insets _insets=new Insets(10,10,10,10);
public Insets getInsets(){
return _insets;
};...should do the trick, take a look at the Insets class if you need information on how defining it... -
Problem with Sessions, Servlets, Netscape and Solaris
We are experiencing a problem that is confounding and frustrating us (I have
a felling that it is something exremely minor that we are overlooking).
Here goes:
Context:
The problem only occurs when using a netscape browser against weblogic
4.51running on our Solaris 7 box (Everything works fine through IE, and
through both browsers against our development machines which are on NT)
Problem:
We have a bunch of JSP pages and servlets that are used togehter throughout
our site. They both manage session information for the user. What is
happening is that there is no problem maintaining session information among
all the JSP pages, but when we hit a servlet that we use to stream graphs
back to the browser, it gets the session but it has no contents all of a
sudden. What seems to be even more strange is that the session is not
tagged as new (by checking isNew()), it is just empty of the contents that
were placed it by the JSP pages. Again, this is only occurring from
Netscape browsers against our Solaris server.
If anyone can provide any help it would be greatly appreciated. I can
provide more details if need be.
Jeremy
There is a property in the weblogic.properties file that lets you set
the cookie name. If this isn't set, the port will be appended as part of
the name. I've had a similar problem switching between http and https
and losing sessions.
Carles
Jeremy wrote:
>
> in the link tothe servlet the URL had a :80 in it. This was because the url
> was generated by a JSP page so that when it was moved from server to server
> and port to port the code wouldn't have to be changed. Unfortuneately,
> Netscape sucks and takes this to mean that x.x.x.x and x.x.x.x:80 are
> different and won't acknowledge the cookie from the JSP pages (x.x.x.x) to
> the servlet (x.x.x.x:80). Thanks fpr your help.
>
> Jeremy <[email protected]> wrote in message
> news:[email protected]...
> > my mistake, it appears to always happen on port 80 regardless of the
> server
> > it is on.
> >
> > Jeff Martin <[email protected]> wrote in message
> > news:[email protected]...
> > > It really sounds like your servlet is making a new session, even though
> > > isNew() doesn't say so. What you might try to do is use session.getId()
> > > to print out the session ID from your jsp pages as well as your servlets
> > > to determine if it really is a new session.
> > >
> > > Do your servlets and JSPs both use the same scheme (http or https) or
> > > cookie.setSecure()? Do your cookies use domains or paths in either
> > > servlets or jsps (cookies can be restricted to certain subdirectories
> > > which might be different between jsps and servlets)? Are you testing
> > > through a proxy or firewall, or does either browser have different proxy
> > > settings than the others?
> > >
> > > Jeff
> > >
> > > Jeremy wrote:
> > > >
> > > > We are experiencing a problem that is confounding and frustrating us
> (I
> > have
> > > > a felling that it is something exremely minor that we are
> overlooking).
> > > > Here goes:
> > > >
> > > > Context:
> > > > The problem only occurs when using a netscape browser against weblogic
> > > > 4.51running on our Solaris 7 box (Everything works fine through IE,
> and
> > > > through both browsers against our development machines which are on
> NT)
> > > >
> > > > Problem:
> > > > We have a bunch of JSP pages and servlets that are used togehter
> > throughout
> > > > our site. They both manage session information for the user. What is
> > > > happening is that there is no problem maintaining session information
> > among
> > > > all the JSP pages, but when we hit a servlet that we use to stream
> > graphs
> > > > back to the browser, it gets the session but it has no contents all of
> a
> > > > sudden. What seems to be even more strange is that the session is not
> > > > tagged as new (by checking isNew()), it is just empty of the contents
> > that
> > > > were placed it by the JSP pages. Again, this is only occurring from
> > > > Netscape browsers against our Solaris server.
> > > >
> > > > If anyone can provide any help it would be greatly appreciated. I can
> > > > provide more details if need be.
> > > >
> > > > Jeremy
> >
> >
-
Problem with ScrollPane and JFrame Size
Hi,
The code is workin but after change the size of frame it works CORRECTLY.Please help me why this frame is small an scrollpane doesn't show at the beginning.
Here is the code:
import java.awt.*;
public class canvasExp extends Canvas
private static final long serialVersionUID = 1L;
ImageLoader map=new ImageLoader();
Image img = map.GetImg();
int h, w; // the height and width of this canvas
public void update(Graphics g)
paint(g);
public void paint(Graphics g)
if(img != null)
h = getSize().height;
System.out.println("h:"+h);
w = getSize().width;
System.out.println("w:"+w);
g.drawRect(0,0, w-1, h-1); // Draw border
// System.out.println("Size= "+this.getSize());
g.drawImage(img, 0,0,this.getWidth(),this.getHeight(), this);
int width = img.getWidth(this);
//System.out.println("W: "+width);
int height = img.getHeight(this);
//System.out.println("H: "+height);
if(width != -1 && width != getWidth())
setSize(width, getHeight());
if(height != -1 && height != getHeight())
setSize(getWidth(), height);
}I create frame here...
import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
public class frame extends JFrame implements MouseMotionListener,MouseListener
private static final long serialVersionUID = 1L;
private ScrollPane scrollPane;
private int dragStartX;
private int dragStartY;
private int lastX;
private int lastY;
int cordX;
int cordY;
canvasExp canvas;
public frame()
super("test");
canvas = new canvasExp();
canvas.addMouseListener(this);
canvas.addMouseMotionListener(this);
scrollPane = new ScrollPane();
scrollPane.setEnabled(true);
scrollPane.add(canvas);
add(scrollPane);
setSize(300,300);
pack();
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void mousePressed(MouseEvent e)
dragStartX = e.getX();
dragStartY = e.getY();
lastX = getX();
lastY = getY();
public void mouseReleased(MouseEvent mouseevent)
public void mouseClicked(MouseEvent e)
cordX = e.getX();
cordY = e.getY();
System.out.println((new StringBuilder()).append(cordX).append(",").append(cordY).toString());
public void mouseEntered(MouseEvent mouseevent)
public void mouseExited(MouseEvent mouseevent)
public void mouseMoved(MouseEvent mouseevent)
public void mouseDragged(MouseEvent e)
if(e.getX() != lastX || e.getY() != lastY)
Point p = scrollPane.getScrollPosition();
p.translate(dragStartX - e.getX(), dragStartY - e.getY());
scrollPane.setScrollPosition(p);
}...and call here
public class main {
public main(){}
public static void main (String args[])
frame f = new frame();
}There is something I couldn't see here.By the way ImageLoader is workin I get the image.
Thank you for your help,please answer me....I'm not going to even attempt to resolve the problem posted. There are other problems with your code that should take priority.
-- class names by convention start with a capital letter.
-- don't use the name of a common class from the standard API for your custom class, not even with a difference of case. It'll come back to bite you.
-- don't mix awt and Swing components in the same GUI. Change your class that extends Canvas to extend JPanel instead, and override paintComponent(...) instead of paint(...).
-- launch your GUI on the EDT by wrapping it in a SwingUtilities.invokeLater or EventQueue.invokeLater.
-- calling setSize(...) followed by pack() is meaningless. Use one or the other.
-- That's not the correct way to display a component in a scroll pane.
Ah, well, and the problem is that when you call pack(), it retrieves the preferredSize of the components in the JFrame, and you haven't set a preferredSize for the scroll pane.
Please, for your own good, take a break from whatever it is you're working on and go through The Java™ Tutorials: [Creating a GUI with JFC/Swing|http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]
db -
Problem with drawing in a scrollpane using clipbounds
Hello
Setup is a JFrame containing a splitpane with on the left just some config buttons and on the right a scrollpane.
Inside the scrollpane I want to draw big waveforms.
This is represented by a long array of 1's and 0's for the Y coordinates.
On drawing in paintComponents method I allways reconstruct a GeneralPath, based on the Clipbouns returned by the Graphics variable.
I have to reconstruct the GeneralPath polygon because my data can be millions long. And therefor I have to limit the points that are drawn.
When I allways reconstruct this GeneralPath, upon scrolling the polygon is shown scrappy, as in the line connecting the points will only be half shown or almost not.
Resizing the window or just minimize maximize and it is shown ok.
I do not have this problem when the GeneralPath I construct is only once made upfront and never remade in the paintComponent method.
But as I need the clipbounds to know which part to construct I need to rebuild this polygon over and over again.
I have tried to draw it with Line2D.Double but I get almost the same effect, parts of the lines not being drawn ok.
Below is the code of the Panel inside the ScrollPane responsible for this drawing.
public class Usr_Test_L extends JPanel
final static Color bg = Color.black;
final static Color fg = Color.white;
final static Color wave = Color.red;
final static Color txt = Color.green;
final static Color grid = Color.lightGray;
private static final BasicStroke SOLID = new BasicStroke(1.0f);
private static final BasicStroke BOLD = new BasicStroke(3.0f);
private double maxX = 0.0;
private double maxY = 0.0;
private double gridWidth;
private double gridHeight;
private int panelWidth;
private int panelHeight;
boolean firstTime = true;
private double[] xPoints = null;
private double[] yPoints = null;
GeneralPath polygon;
boolean polyOk = false;
private double waveHeight = 0;
private boolean gridOn = true;
private Usr_Test_R scrollPane = null;
Usr_Test_L(Usr_Test_R scrollPane)
super(true);
this.scrollPane = scrollPane;
buildGui();
void buildGui()
setBackground(bg);
setForeground(fg);
//Let the user scroll by dragging to outside the window.
setAutoscrolls(true); //enable synthetic drag events
// addMouseMotionListener(this); //handle mouse drags
repaint();
private void generateWave(int cycles, double height)
waveHeight = height;
xPoints = new double[cycles];
yPoints = new double[cycles];
Random r = new Random();
for ( int i = 0; i < cycles; i++ )
xPoints[i] = i;
yPoints[i] = (int)( Math.pow(-1.0,i) ) * ( r.nextInt(2) );
// if ( ( i % 10 ) == 0 ) yPoints[i] = height;
// else yPoints[i] = height + gridHeight;
// System.err.println("P"+i+"("+xPoints[i]+","+yPoints[i]+")");
private void generateSineWave(int cycles, double height)
waveHeight = height;
xPoints = new double[cycles];
yPoints = new double[cycles];
double j, xval, yval;
j = 0;
int i = 0;
while (i < cycles)
xval = j;
yval = Math.sin(j) * 10.0 + 20;
xPoints[i] = xval;
yPoints[i] = yval;
i++;
j += 0.01;
public Dimension getPreferredSize() // <== used because of revalidate, parent scrollpane asks preferredsize ..., so we overruled the method
return new Dimension(panelWidth, panelHeight);
public void drawLine(int cycles, int height)
generateWave(cycles,(int)(gridHeight*height));
maxX = gridWidth * cycles;
maxY = gridHeight * cycles;
while ( maxX > panelWidth ) panelWidth *= 2;
while ( maxY > panelHeight ) panelHeight *= 2;
// polyOk = buildPolygon();
revalidate();
repaint();
public void drawSine(int cycles, int height)
generateSineWave(cycles,(int)(gridHeight*height));
maxX = gridWidth * cycles;
maxY = gridHeight * cycles;
while ( maxX > panelWidth ) panelWidth *= 2;
while ( maxY > panelHeight ) panelHeight *= 2;
// polyOk = buildPolygon();
revalidate();
repaint();
public void zoomIn()
gridWidth *= 2;
gridHeight *= 2;
repaint();
public void zoomOut()
gridWidth /= 2;
gridHeight /= 2;
repaint();
private void initPanel()
Dimension d = getSize();
panelWidth = d.width;
panelHeight = d.height;
maxX = panelWidth;
maxY = panelHeight;
gridWidth = panelWidth / 8;
gridHeight = panelHeight / 8;
scrollPane.getHorBar().setUnitIncrement((int)(gridWidth*3)); // times 2 otherwise no clipbounds are allways too small
scrollPane.getHorBar().setBlockIncrement((int)(gridWidth*3));
scrollPane.getVerBar().setUnitIncrement((int)(gridHeight*3));
scrollPane.getVerBar().setBlockIncrement((int)(gridHeight*3));
public void grid()
if ( gridOn ) gridOn = false;
else gridOn = true;
private void drawGrid(Graphics2D g2, Rectangle clip)
if ( ! gridOn ) return;
// draw grid
g2.setPaint(grid);
// new good grid
double startX = clip.getX() + ( gridWidth - ( clip.getX() % gridWidth ) );
double endX = clip.getX() + clip.getWidth();
double startY = clip.getY() + ( gridHeight - ( clip.getY() % gridHeight ) );
double endY = clip.getY() + clip.getHeight();
double y = startY;
while ( startX < endX )
while ( y < endY )
g2.draw(new Rectangle2D.Double( startX - 0.5, y - 0.5, 1.0, 1.0 ));
y += gridHeight;
y = startY;
startX += gridWidth;
private boolean buildPolygon(Rectangle clip)
if ( xPoints != null && yPoints != null )
polygon = new GeneralPath(GeneralPath.WIND_NON_ZERO,xPoints.length);
else
return false;
double x = xPoints[0] * gridWidth;
double y = waveHeight;
polygon.moveTo((float)xPoints[0], (float)yPoints[0]);
for ( int index = 0; index < xPoints.length; index++ )
x = xPoints[index] * gridWidth;
y = waveHeight + ( yPoints[index] * gridHeight );
if ( x > ( clip.getX() + clip.getWidth() ) ) break;
if ( y < clip.getY() || y > ( clip.getY() + clip.getHeight() ) ) continue;
if ( x < clip.getX() || x > ( clip.getX() + clip.getWidth() ) ) continue;
polygon.lineTo((float)x, (float)y);
return true;
private boolean drawLines(Graphics2D g2, Rectangle clip)
if ( xPoints == null || yPoints == null ) return false;
double x1 = xPoints[0] * gridWidth;
double y1 = waveHeight;
double x2, y2;
boolean cont = false;
for ( int index = 0; index < xPoints.length; index++ )
x2 = xPoints[index] * gridWidth;
y2 = waveHeight + ( yPoints[index] * gridHeight );
if ( x1 > ( clip.getX() + clip.getWidth() ) )
break;
if ( x2 > ( clip.getX() + clip.getWidth() ) )
break;
if ( y2 < clip.getY() || y2 > ( clip.getY() + clip.getHeight() ) )
cont = true;
if ( x2 < clip.getX() || x2 > ( clip.getX() + clip.getWidth() ) )
cont = true;
if ( ! cont ) g2.draw(new Line2D.Double(x1,y1,x2,y2));
x1 = x2;
y1 = y2;
cont = false;
return true;
public void paintComponent(Graphics g)
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
if ( firstTime )
initPanel();
firstTime = false;
// get clip bounds
Rectangle clip = new Rectangle();
clip = g2.getClipBounds(clip);
// draw grid
drawGrid(g2,clip);
// draw waveform
g2.setPaint(wave);
g2.setStroke(SOLID);
if ( buildPolygon(clip) ) g2.draw(polygon);
// if ( polyOk ) g2.draw(polygon);
// drawLines(g2,clip);
}I have added a standalone testcase for ease.
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
import java.util.*;
public class Scrolling {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new JScrollPane(new DrawPanel()));
f.setSize(400,300);
f.setLocationRelativeTo(null);
f.setVisible(true);
class DrawPanel extends JPanel {
private GeneralPath polygon = new GeneralPath(GeneralPath.WIND_NON_ZERO,1000);
private int[] coords;
public DrawPanel() {
setBackground(Color.white);
buildPolygon();
private void buildPolygon() {
coords = new int[2000];
Random r = new Random();
int height = 80;
int gridHeight = 10;
int gridWidth = 10;
int j = 0;
for (int i=0, dir=-1; i<1000; i++, dir=-dir) {
coords[j++] = i * gridWidth;
coords[j++] = height + dir*gridHeight*r.nextInt(2);
private void drawPolygonClipped(Rectangle clip)
polygon = new GeneralPath(GeneralPath.WIND_NON_ZERO,1000);
polygon.moveTo(0,80);
for ( int i = 0; i < 2000; i++ )
if ( coords[i] > ( clip.getX() + clip.getWidth() ) ) break;
if ( coords[i+1] < clip.getY() || coords[i+1] > ( clip.getY() + clip.getHeight() ) ) continue;
if ( coords[i] < clip.getX() || coords[i] > ( clip.getX() + clip.getWidth() ) ) continue;
polygon.lineTo(coords[i++],coords);
private void drawPolygon(Rectangle clip)
polygon = new GeneralPath(GeneralPath.WIND_NON_ZERO,1000);
polygon.moveTo(0,80);
for ( int i = 0; i < 2000; i++ )
polygon.lineTo(coords[i++],coords[i]);
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
Rectangle clip = new Rectangle();
g.getClipBounds(clip);
drawPolygonClipped(clip);
//drawPolygon(clip);
g2.draw(polygon);
public Dimension getPreferredSize() {
return new Dimension(1500,500); -
My web site is generated by Second Site , author John Cardinal, and contains email links which when selected automatically createsan email which all you need to do is fill in the body and send it. This has worked in the past in Firefox and does work now using IE 8, Opera, and Netscape browsers but does not work when using my Firefox browser neither locally on my computer or in my Internet website. Firefox is my browser of choice. This has worked in the past using Firefox.
My web site is www.schulteis.com/omnibus/. On the presentation page, on the bottom, where it identifies Genealogist: Site Administrator. Select it and it may work for you. John Cardinal tested it on his local machine and it worked for him. His response to me was,
"It's very likely that this is some sort of browser configuration error, and it's probably related to using a web-based email client, In
Firefox, look under Options > Applications and see how the "Mailto" Content type is configured. It should probably say "Use Yahoo Mail" [it does]. I have never configured a browser to use a web-base email client, so I can't help more than that.
Since this works fine on my computer and on my Internet site when using browsers IE 8, Opera, and Netscape but not Firefox, and I didn't do anything special for any browser to cause it to work, don't know what I could have done wrong for Firefox.
I am using Yahoo mail.
Thanks for your help
Donald
[email protected]I'm also running FF 36.0.4 on a Win 7 machine. Here is what I see when I "open" the map (from the server - not inside DW):
The map area stays white with no image even after several minutes. The cursor does change to a hand when over the area where the map should be and if I click and drag there the cursor switches to the closed hand - so it's acting like the map is there and can be moved - but just no map shows up.
I'll run it though the validator. Thanks! -
JScrollpane does not work properly when I interlinked to another Scrollpane
Hi,
I am trying to develop a small Editor using java Swing. I hav to display Line numbers also. for that i used another textarea and set the scrollbar model of that to the scrollbar model of text area where i type the programs. the module works perfectly in the first appearance.. scrolls same time..but the problem arises when i insert a new line into or delete a new line from the text area. when i am inserting or deleting the scrollbar of the prgram text area scrolls down immdtly after the insertion or deletion...
I tried a lot to solve the problem. Please help me...I hav to display Line numbers ...Whatever component you use to display the line number you should add the component directly to the scroll pane that contains your main text area. You do this by using the scrollPane.setRowHeaderView(). I've posted several example of this if you search the forums.
Maybe you are looking for
-
Hi; Can someone tell me how can we clear the GR/IR balances; MR11 will clear the amounts; is there a samething to clear the GR/IR balances. Thanks Ibou
-
Iphoto has a circle with line through it. its iPhoto 9.2.3. I go to the app store and try and download the new version and i get these windows. if someone can help that would be great. also i had problems installing maverick I'm backing up my hard dr
-
Transcoding MPEG-2 to Quicktime to edit in FCP X
Hello, I have many DVD's I've burned from S-VHS tapes. Is it possible to somehow transcode the MPEG 2 files so I can edit the material in FCP X? I tried and Compressor won't accept the files. I would appreciate any help anyone could offer. Thank y
-
IMovie cant find camera Sony DCR-TRV33E
I have Sony DCR-TRV33E Camcorder and MacOSX Tiger. is it really so that it is not possible to use the camera with iMovie? I cant find this type from the supported list http://www.apple.com/macosx/upgrade/camcorders.html there are tens of other DCR-TR
-
Curious about this From clause in Oracle XE
SQL view of query Builder gives the following: select "EMPLOYEES"."EMPLOYEE_ID" as "EMPLOYEE_ID", "EMPLOYEES"."FIRST_NAME" as "FIRST_NAME", "EMPLOYEES"."LAST_NAME" as "LAST_NAME" from "EMPLOYEES" "EMPLOYEES" Why does the from clause