Dashed line with jdk1.1.8?

Hello
Does anyone know how to make dashed lines with jdk 1.1.8? Yes, that means no Graphics 2D nor BasicStoroke class.
Also how do you make the line wider with 1.1.8?
I appreciate any response. Thanks
michiko

int lineLength = 100;
for(int i = 0; i < lineLength ; i = i + 6){
g.drawLine(i,i,i+3,i+3);
how about that?

Similar Messages

  • Can Flash create dashed line with blunt not rounded dashes ?

    Hi,
    using Flash8
    I can select line tool and dashed line in properties and draw a dashed line and get a line of sausages. How do I get a line of dashes without rounded ends to each dash ?
    Line option has end caps option with None (gives straight or blunt tip to line, round gives rounded tip .
    Draw a line with None and its got blunt ends, select it and choose dashed line option and it gets round ends to the dashes, the end cap option is greyed out !
    Are dashed lines with blunt dashes now possible again with CS4, a forum poster also found that CS3 no longer gave blunt dashes ?
    Why do I ask:-
    I am trying to bring a map into Flash8 from Illustrator (Illus version 10 as it allows blunt tip lines to remain blunt it was said on the forum)... which has blunt ends to roads and has blunt type dashed lines. The roads remain blunt..GOOD !..but the dashed lines become what looks like a solid line. BAD !
    I do a right click - break apart,  then double click one of those now solid lines that should be dashed, and I am able to select a portion of the line, it is no longer a continual line as drawn in Illustrator. Properties shows it as solid line. Flash8 obviously having a problem with supporting Illustrator 10 dashed line then !
    Select dashed in properties box and I get a portion of the line as sausage dashes, but working my way along the line doing each bit sees a far from correct dashed line result as sausages dont start stop evenly as each line is a separate entity and ignores the previous line.
    Looks like I shall have to try and draw the line as one long line again in flash but unless I can give it blunt dashes when done, there is no point even trying that method, hence my question.
    Would the latest Illustrator and Flash versions (CS4) allow blunt type dashed lines to appear in Flash ?
    This is crucial for bringing maps into Flash.
    Envirographics

    I noticed one problem with my solution.
    If you look, very carefully, at the end of the stream, it's flat. Not rounded like it should be. After a bit of trial and error, I tried a different brush:
    Note that, in addition to the rounded rectangle (done with the new corner controls in the latest version of Illustrator CC that just came out) and the three circles, there is also a rectangle, with no stroke and no fill, to provide a space at the end of the three dots. Here is the result:

  • Dashed line with more dashes: intermittent stream

    The standard symbol for a stream on topographic maps is a blue line.
    The standard symbol for an intermittent stream on topographic maps is a a blue line, with long segments interrupted regularly with a series of three dots. I can create a dashed line interrupted by two dots, but there aren't enough boxes for me to specify the third dot.
    Any suggestions on the best way to accomplish this?
    Thanks.

    I noticed one problem with my solution.
    If you look, very carefully, at the end of the stream, it's flat. Not rounded like it should be. After a bit of trial and error, I tried a different brush:
    Note that, in addition to the rounded rectangle (done with the new corner controls in the latest version of Illustrator CC that just came out) and the three circles, there is also a rectangle, with no stroke and no fill, to provide a space at the end of the three dots. Here is the result:

  • How to change draw dashed line with arrowhead (not straight)?

    Hi friends,
    The following code sinept draws an arrowed line from a given point to the other point. I want to know how it can changed to be dashed line as well? I would appreciate it if anybody help me for doing such changes.
    Thanks in advance,
    Reza_mp
    import javax.swing.*;
    import java.awt.*;
    import java.util.ArrayList;
    public class ArrowExample extends JFrame
        enum ArrowHead {
            HEIGHT(10), WIDTH(10);
            int n;
            ArrowHead(int n) {this.n = n;}
            public int value() {return n;}
        java.util.List<Arrow> arrows;
        BasicStroke stroke;
        private class Arrow {
            Point start;
            Point end;
            Polygon arrowHead;
            public Arrow(Point start, Point end) {
                this.start = start;
                this.end = end;
                double direction = Math.atan2(end.y - start.y, end.x - start.x);
                System.out.println(direction * 180/Math.PI);
                arrowHead = new Polygon();
                arrowHead.addPoint(0, 0);
                Point p1 = rotate(ArrowHead.WIDTH.value()/2, ArrowHead.HEIGHT.value(), direction);
                arrowHead.addPoint(p1.x, p1.y);
                Point p2 = rotate(-ArrowHead.WIDTH.value()/2, ArrowHead.HEIGHT.value(), direction);
                arrowHead.addPoint(p2.x, p2.y);
                arrowHead.addPoint(0, 0);
                arrowHead.translate(end.x, end.y);
            public Point rotate(int x, int y, double dir) {
                Point p = new Point();
                double r = Math.sqrt(x*x + y*y);
                double theta = Math.atan2(y, x);
                p.setLocation(Math.round(r*Math.cos(theta + dir + Math.PI/2)),
                              Math.round(r*Math.sin(theta + dir + Math.PI/2)));
                return p;
            public void draw(Graphics2D g) {
                g.drawLine(start.x, start.y, end.x, end.y);
                g.drawPolygon(arrowHead);
                g.fillPolygon(arrowHead);
        public ArrowExample() {
            super("Arrows");
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            JPanel p = new JPanel() {
                protected void paintComponent(Graphics g) {
                    super.paintComponent(g);
                    Graphics2D g2d = (Graphics2D)g;
                    Stroke oldStroke = g2d.getStroke();
                    Color oldColor = g2d.getColor();
                    g2d.setStroke(stroke);
                    g2d.setColor(Color.black);
                    for (Arrow a : arrows)
                        a.draw(g2d);
                    g2d.setStroke(oldStroke);
                    g2d.setColor(oldColor);
            p.setBackground(Color.white);
            add(p, BorderLayout.CENTER);
            stroke = new BasicStroke(3);
            arrows = new ArrayList<Arrow>();
            arrows.add(new Arrow(new Point(10,10), new Point(100,100)));
            arrows.add(new Arrow(new Point(300,10), new Point(300,100)));
            arrows.add(new Arrow(new Point(450,450), new Point(400,100)));
            pack();
            setSize(500, 500);
        public static void main(String[] args) {
            setDefaultLookAndFeelDecorated(true);
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new ArrowExample().setVisible(true);
    }

    Change the draw method as follows:
            public void draw(Graphics2D g) {
                Stroke s = g.getStroke();
                g.setStroke( new BasicStroke( 3.0f, BasicStroke.CAP_BUTT,
                   BasicStroke.JOIN_MITER, 1.0f, new float[] { 10.0f, 10.0f }, 0.0f ) );
                g.drawLine(start.x, start.y, end.x, end.y);
                g.setStroke( s );
                g.drawPolygon(arrowHead);
                g.fillPolygon(arrowHead);
            }

  • My dashed line is rendering with a box outline. How can I fix this?

    Hi,
    I am trying to create a dashed line with the simple line widget - however a box is actually appearing in the final page (in addition to the dashed line), as below:
    How can I adjust it so only the dashed line appears? I can't see any options for it.
    Many thanks,
    Jeremy

    Check that the widget itself hasn't got a stroke applied to it.
    Can I also recommend you have a look at my latest widget, which gives you full control over frame borders.
    Better Frame Borders Widget For Adobe Muse | Creative Muse
    David

  • Make a dashed line...

    How can i make a dashed line with the rectangle tool?

    With Muse 7, you can use the 'SimpleLine' widget posted on Muse exchange to get a horizontal or vertical line, with options for solid, dots, or dashes.
    http://muse.adobe.com/exchange-library/lances-sample-widgets

  • Problem with dashed line spacing when printing to pdf

    Hi all,
    this may be a problem with my pdf program (I use bluebeam), but maybe someone will have an idea how to fix it whether in indesign or bluebeam.
    so I made a dashed line using the stroke command in indesign. I need to have the spacing set to 3pt dash and 2pt space. I also need to keep the lineweight to 0.5...this all works fine and appears correctly in indesign when I preview
    the problem is that some of the dashed lines, but not all of them, change size and spacing in the pdf when I view it. it seems to change when I zoom in and out as well. I thought maybe this was just some odd feature with bluebeam and it would still print to the correct size, but it does not, it prints the lines as different sizes. does anyone have an idea why this happens and how to fix? ive viewed and printed from adobe reader and it seems to be okay there but this file will be accessed by multiple other people and they may not be opening and printing in adobe reader..
    thanks guys

    When you export a PDF you will notice that you are exporting to Adobe PDF. Using any reader beyond Acrobat Pro or Reader is a crapshoot.
    For issues with Bluebeam I suggest you contact the developer.

  • How do I outline an object with a dash line in Photoshop CS6?

    How do I outline an object (silhouette figure) with a dash line in Photoshop CS6? ... never was this difficult.

    I have a silhouetted figure I'd like to outline with a dash line ... Will I have to manually outline the object ... what alternative do I have?

  • Outline an object with a dash line in PS CS6

    I have a silhouetted figure I'd like to outline with a dash line ... I understand the basic concept, but will I have to manually outline the object ... can't seem to get it to work out ... what alternative do I have?

    I have a silhouetted figure I'd like to outline with a dash line ... Will I have to manually outline the object ... what alternative do I have?

  • Other Components Drawing Dashed Lines doesn't compile with Flex 4

    The lib was created in 2006 so it doesn't compile with Flex 4.
    The lib can be downloaded here http://www.quietlyscheming.com/blog/charts/dashed-lines/
    When compiling I get this error:
    Description     Resource     Path     Location     Type
    1136: Incorrect number of arguments.  Expected 3.     GraphicsUtils.as     /arrows/src/qs/utils     line 66     Flex Problem
    The line which doesn't compile:
    stroke.apply(target);
    How do I fix this error?

    I managed to compile the lib by rewriting the line:
    stroke.apply(target, new Rectangle(), new Point());
    But I don't understand what I have done.
    All Rectangle and Point dimensions are 0, but I'm sure it shouldn't be this way.

  • HT2513 When accept an appointment in iCAL, I often get a box with dashed lines.  What does that mean and how do I correct it

    The appointment appears in iCal as a box with dashed lines.  I have been unable to find out wha this means and a method to change it to a normal solid box.

    You can use a keyboard command to prevent your iPod auto-syncing with iTunes. While connecting the iPod to the computer on a Mac hold down the Option and Command (⌥ and ⌘ Apple) keys together. This will stop the iPod from auto-syncing with iTunes and it will appear in the source list. Wait until you are sure the iPod has mounted, and that it will not auto sync and then you can let the keys go. This may take between 20 to 30 seconds depending on your computer. Once you are safely connected go to the iPod Summary tab and make sure "manually manage music and videos" is checked:
    iTunes for Mac - Keyboard Shortcuts
    Managing content manually on iPod and iPhone

  • Illustrator CS2 adds mysterious white dashed line thru my linked Photoshop file

    Im using Windows XP, Illustrator & Photoshop CS2, Acrobat 7.0 Professional.
    I have an illustrator file with a linked PSD file that has this mysterious thin white dashed line going through the entire image & I have no idea what it's from or how to repair it.
    My trouble shooting thus far includes:
    - In illustrator - I hide all the layers to see if there was an odd graphic on another layer that was causing the line, nothing. I tried to select the dashed line, not possible. I've created a PDF of the file, and the dashed line is in the PDF too (to verify it wasn't just Illustrator). Oddly in both Acrobat & Illustrator when I zoom in & zoom out, the dashes maintain their on-screen viewing proportions (like the dash spaces recalculate to the same tiny thin dashed line no matter what zoom Im at)
    - In Photoshop - I zoomed in until I couldn't zoom no more and there is not the slightest dashed line in the graphic.
    Lastly, I have this exact linked setup repeated throughout several different files (basically its the same ad but laid out to different dimensions for each)... and none of the others have this mysterious white dashed line.
    here's a screen capture from Acrobat... zoomed into 6400%
    argh - can someone help? Thanks!
    kristin

    Hi guys (and sorry for the tremendous delayed response).
    No the line doesn't print on my local b/w laser printer. However I have seen the lines print in 1 newspaper publications... (this is out of 50 different publications)
    Yes, the image is rotated slightly in illustrator, and I always flatten prior to making the PDF (cuz of the transparency/drop shadow).
    It's really making me nervous that ALL our ads have these lines appearing during onscreen viewing... Im making a new batch of ads for our campaign & there are more lines than before!
    Any tips theories remedies my friends?

  • Draw a continuous dashed line

    I suspect the answer is simpler than I expect, but it has been eluding me none the less, so I've been wondering how to draw a continuous dashed line, as per the title. I'm cleaning up a photo I made a while back and would to create a flowing line and set it to be dashed as you can do in Adobe Illustrator, where you could draw a line and edit the line type to be dashed, or dotted, or a bunch of snowflakes or what have you.
    I can hear you asking, "why not just use Illustrator?". Well, I do not have it. I used Illustrator and Photoshop CS6 in an art class senior year of high school, but it has been a little while so I'm trying to re-learn the ropes a little bit.

    I was able to use Filter - Other - Minimum with a particular set of parameters, followed by a Median filter to smooth the results, to get something not unlike what you showed, but given that I derived the parameters empirically from your very limited image, at exactly the size given, I wouldn't be surprised if the characteristics of this sequence of operations are way off from what you want.
    In any case, if you'd like to see this "proof of concept" action to understand what I did, here it is:
    http://Noel.ProDigitalSoftware.com/ForumPosts/BlackFindingAction.zip
    Keep in mind this will be VERY sensitive to the thresholds and sizes chosen for the various steps, and is crafted to work at an image with just the resolution you showed above.
    -Noel

  • How do I create a dashed line growing longer?

    Hi all,
    I want to create a dashed line that grows longer. I made two keyframes (at frame 1 and frame 15) with dashed lines of different lengths. Motion or Classic Tween just makes the small line move to the right and then turn into the long line immediately at frame 15.
    Shape Tween gets me the closest (actually shows a line growing), however, it turns into a solid line in the intermediate steps.
    My next idea is to create a mask that slowly reveals more of the line. Is that the best solution?
    Thanks!

    yes, use a tweened mask.  that's the easiest solution.

  • Can not draw a solid line after drawing a dashed line

    I have been using a Graphics2D object in order to paint onto a buffered image and then transition that to a panel for viewing. The way the program works requires me to create the dashed line first through BasicStroke. After doing this I have tried to reset the setStroke with multiple new pens including BasicStroke(), BasicStroke(1.0f), and BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.0f, new float[] {1,0}, 0.0f).
    Any ideas as to why I am still incapiable of drawing a solid line?

    Any ideas as to why I am still incapiable of drawing
    a solid line?Without seeing any code, I could guess, but my guess and a quarter won�t even buy you a newspaper around here now a days.
    Seriously though, you need to create a short, self contained, compilable example. Look here for an explanation on how to create this:
    http://www.physci.org/codes/sscce/

Maybe you are looking for

  • Reset of clearing documents with open items managed accounts

    Hi, I posted OI clearing document in Nov 2013 and had to reset it in March 2014. This rest impact my 2013 balances. Does anyone know why this document has been reset with old period? thank you

  • N:1 mapping using XSLT

    Hi, I have a scenario in which i have to do a N:1 mapping using XSLT. I am doing this using the BpmPatternCollectMultiIf giving the XSLT mapping in the transformation step... But, the transformation step is returning the following error: Error: Excep

  • Does it do any good to use a "N" router with a "G" computer

    I need a little more range not speed. I see extended range "G" routers but they cost as much as an "N router.  I would continue to use a standard "G" internal card in the computer. 

  • AIR file extensiòn *.air - howto help needed

    Hola¡¡ I have Adobe AIR (es nou) I have Adobe Media Player (es nou) I have Adobe Flex Builder (es nou .. 3.0) I have Adobe AIR project in Adobe Flex Builder It not run the Adobe AIR Program >>> Windows not can make AIR runtime and AIR fitxers. PERO>>

  • Windows Vista connects to TC/Airport, but not internet

    I have long had a Windows Vista notebook (HP Pavilion dv6000) connect well via a Time Capsule to the internet, along with a PowerBook G4. I recently added an iMac (27" 3.06 dual core) and all was well for a few days, but then had to reset the Pavilio