In collaboration with the canvas. Don't fill the rectangle.

Hey, I work with the canvas.

[code]

G2d GraphicsContext;

g2d.strokeRect (x, y, w, h); Rect is drawn.

g2d.setStroke (Color.White); Strokes are white, works just as well.

g2d.setFill (Color.Blue); Nothing happens. I'm waiting for the rectangle to be filled with blue. I'm doing something wrong?

[/ code]

Thanks to you all.

Edit: lmao, try to format my text.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class CanvasFillRectTest extends Application {

    @Override
    public void start(Stage primaryStage) {
        Canvas canvas = new Canvas(400, 400);
        GraphicsContext gc = canvas.getGraphicsContext2D();
        gc.setFill(Color.BLUE);
        gc.setStroke(Color.WHITE);
        gc.fillRect(50, 50, 300, 200);
        gc.strokeRect(50, 50, 300, 200);

        Pane pane = new Pane();
        pane.getChildren().add(canvas);
        Scene scene = new Scene(pane, 400, 400, Color.CORNFLOWERBLUE);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Edit: lmao, try to format my text.

Choose "Use the Advanced Editor" at the top... and then select your code, press the button marked "insert" >, select syntax, Java.

Tags: Java

Similar Questions

  • Change the thickness of the lines created with the Rectangle tool in CS2?

    I'm trying to change the thickness of the lines for a rectangle drawn with the Rectangle tool in Photoshop CS2.

    I can't understand how change the thickness of the lines of the four sides of the rectangle before I draw the rectangle by using the Rectangle tool or after the Rectangle was drawn. The same problem seems to occur when you use the tool polygon, Ellispse tool, etc.

    I can turn the rectangle to make it bigger or smaller, etc., but it seems that I should be able to vary the thickness of the lines for a rectangle.

    This task is possible in Photoshop?  It's simple in Illustrator - it seems it should be a fairly simple task in P-shop.  I looked on Google and in help for P-shop CS2 for a response but cannot locate a solution.  I don't see something really obvious?

    Any help is greatly appeciated.

    Thank you!

    Read post 1 once again. You want to use the layer style (double click to the right of the name of the layer in the layers panel) and use the option of the race. You can even set layer styles to apply to objects with a single click. If you frequently need the thick rectangle, it will be a click.

    Layer style presets that are predefined values and cannot be changed on the fly just like real styles, but they are still very useful.

  • problem rotating rectangle (selection of corners) after you have created with the rectangle tool in illustrator

    I use the latest version of the CC of the Illustrator. When I draw a rectangle by using the rectangle tool, I no longer seem to be able to select the corners to resize the rectangle or the cursor turns to a rotate icon when I put the mouse just outside the angle. Now I know that AI rectangles treated CC differently, with the direct rectangles and rounded corners options and the processing area opening automatically. What I was asking and hope is not the case, is if it's that costs that can go right and resize using just the mouse? I know that there is the "object > shape > Expand" option, but having to do whenever I have a rectangle is time consuming and adds and the extra step that was necessary before. I saw a tutorial on Lynda where the instructor drew a direct rectangle in CC AND was still able to resize by grabbing the handle angle «» Anyone know if it's just a setting that I need to start or something even easy, or it is done inadvertently Adobe workflow longer trying to make it easier? And Yes, I have "show encompassing" selected under VIEW.

    MOD indi-go girl,

    I'm afraid that have met you the Rectangle Live bug that is limited to the MAC versions from 10.7 and 10.8, but not of 10.9 (Mavericks) or 10.10 (Yosemite). If all goes well, the bug will be fixed soon.

    Thus, a switch for the Mavericks or Yosemite with a reinstall might be the way to solve it here and now.

    To get around it, in each case, it is possible to develop direct Rectangles to get the normal old shaped rectangles or Pathfinder > unit, or use the scale tool or the free transform tool.

    A more permanent way round that is to create normal old shaped rectangles, after running the free script created by Pawel, see this thread with download link:

    https://forums.Adobe.com/thread/1587587

  • Why I can't change the size or orientation of a figure that I did with the rectangle tool?

    Hello, today I updated my CC and when I use the rectangle tool, it does not give me the nodes to scale or rotate, but if I create a character with the pen tool nodes appear, I am on a MAC, I already try on PC and it has no problem, someone knows what's going on?

    Hi Karla Leo,

    The problem has been reported to engineering, and they are working on it.

    However, the problem seems with an earlier version of MAC OS x. It works great in 10.9.x leave.

    I hope this helps.

    Kind regards

    Sumit Singh

  • Problems with the Rectangle tool

    Hello

    I'm having a problem. I created three camembert grahics with some text and boxes. Everything has been created in Muse, with the exception of the three piecharts, which are some PNGs. I created a box colored (using the rectangle tool) and placed behind the content. When I discover in preview (as well as the preview in the browser), two of the graphics look good, but the first, is a couple of pixles shorter in height. I have attached a screenshot of the workspace of MUSE and the preview for comparrison screen. Everyone on the pitch "containers" should be 600 px in height, but when I inspect element in the browser, the height of the first 'container' is 594px and the other two "containers" are 599px each. How is it possible for the first "container" to lose 6px in height and two others to lose a px of height?

    Can someone help me with this please? As a designer with little knowledge of coding, I really like the potential of MUSE, but it's these little "quirks" who eat my time and are not really profitable to my budget projects and timelines.

    Muse01.jpgMuse02.jpg

    Post edited by: kmonk9000

    The exact issue and ways to get out of it is detailed in the video here - http://www.screencast.com/t/ao3syjgXa.

    Thank you

    Vinayak

  • How can I change the frame surrounding a title created with the Rectangle tool?

    Pre 7, I was create titles (for example: title > new title > default always, etc.) for a long time and using many ways to manipulate the text (type, color, size, animation, etc.). Today, I tried to use the Rectangle or Ellipse tool tool (or the line tool) and they created a nice 'framework' (like a picture frame: artistically designed and colored) and I can change the background color in the frame and the place of any text (also background image, etc.) inside. However, I couldn't find any way to change the 'framework' or the general style of the title objects. Is it possible to do, or it's the only design that can be created with these tools? I would be very happy any help (impossible to find in this site u2u). Thanks, Laci.

    LACI,

    Yes, you can apply Styles to several Rectangles (or other shapes), to simulate an "image." The Styles should appear as the text in the Styles Panel. As you work with shapes, but look a the Styles applied to the text, it is not perfectly intuitive as to what look like these Styles with shapes.

    Personally, I find that make things like "frames" in Photoshop and then import the PSD in the meadow are much, much easier. In this case, I would place the PSD on 1 video track (except if I wanted it appear superimposed on my video (like a PiP), can make the text in a title of PrE and place it above the PSD.

    Here is an example:

    It is a simple "picture frame" created in PS. I used a fixed image, instead of the text in this case. These could be "grained," "granite", etc.

    Much more control and tons of effects and filters that can be applied.

    Good luck

    Hunt

    PS - It's PrPro, so the GUI will be quite different, but things work the same way.

  • In collaboration with the binary.

    I need to check if there is an easier way to do that I think.

    If I have an 8-bit binary (i.e. 10111001) entry, I need to check if each individual bits are high '1' or '0' low. My first thought was to start the individual bits but that it becomes messy start masking mask bits (I end up with 8 'AND') and a big enough case Structure.

    Anyone have a better (CLEANER) idea?

    Thank you

    Kas

    You want to take action for each bit diiferent is true? If so, you can just wire a digital U8 to a number of table Boolean. Thread that a loop with an instruction box inside. If this is not the case, there would be a second case statement both true and false and this would be connected to the terminal of iteration. You would create case 0-7. The structure of outermost case of termial wiring to the iteration with a true/false, within each of them will do the same thing.

  • CC of collaboration with the client

    My client and I work off CC together and lately, she has problems with PDF files and idml corrupt when it downloaded on his pc.

    Is this something that know other people? Is there something we can do to prevent this?

    Hello

    You will probably have to inform him to Contact Customer Service as technical troubleshooting could be done for her deliverance.

    Kind regards

    Sheena

  • Create the file with the rectangle on a white square background photo

    I want to create a jpg file square with a rectangular image with a white background. So I need a white white square that I can put a rectangular image on top of. How would I do that? Thank you!

    It would probably be easier to do it using Photoshop, but it can be done. You must use the module printing and in the area of setting page where you configure your printer driver, you need to define a square paper size. Then you can place your image on this model and then print to a file that will create a JPEG image.

  • problem with the Rectangle tool

    Hello

    Have a little problem with this tool

    This is the tool in the top left of the toolbar

    It has a drop-down menu, so that you can select square or circle

    I put in place but when I click and drag on the image / page I do not get a square I get an object that has the rounded corners

    Copy and paste pasta, and it's a half shade around the page

    Well, I never want to; I just want to set its value by default please

    Thank you

    Batista230

    In the tool options bar, set the feather 0 px.

    MTSTUNER

  • Need help with the decision of the laptop

    I'm sorry for the length of this post, but I really need help. I am buying a laptop and what should be a very exciting perspective (my first laptop purchase) turns into a nightmare that had me pretty much in tears over the weekend.

    My budget is not big - absolute maximum of 600 pounds, but I'd rather spend a little less than that.

    I mainly work of office (Word, Excel, database and PowerPoint) and also some Photoshop work. I also play a strategy game called Caesar 3. I want to charge my copy of XP on the computer or replace Vista or as a partition.

    Looking through the available templates in my price range and rising benchmarks, I found the following:

    Most have processors such as the Intel T5250 or T5450 or AMD TL 58, which are all rated as ok, but not very well. Some have the AMD TL 60, which is a little better and one or two have the T7200 Intel which is even better.

    On most of the machines graphics cards are the ATI Radeon Xpress X 1200 or the Intel GMA X 3100. These two are calibrated as not terrible and the review says that they cannot manage strategy games. Some of the models have the ATI Mobility Radeon HD 2400 and HD 2400XT and one or two have the HD 2600.

    The problem is that the models that have the best processor have the lower rated graphics card and those who do not have XP drivers, I see.

    Don't mind a 15.4 screen "(although the 17.1" would be very nice to have) and want a pretty big hard drive (160 +). I get 2 GB of RAM.

    I'm at my wits end. I don't want to buy a computer that will eventually take a minute or more to refresh a screen when you have more than two things open, or you will have to keep rebooting to make it work. I want to be able to play my one and only (Caesar III) game which is a strategy game and I want to be able to work in Photoshop and maybe one or two other things open at the same time, as a website perhaps.

    Help me please, anyone. I asking the impossible? I can't get my hands on an email address for Toshiba try to get clarity on their part on the issue of drivers and they will be available in the future.

    Then there is of course the issue detailing as each stock only a limited number of models, and we must choose between those detailing.

    I hope someone can help me!

    Hello

    The problem is you want to buy a laptop all over the place but don t want to spend a lot of money.

    In addition, you want to change the XP operating system and have XP drivers.

    Well it's boyfriend very difficult decision ;)

    A laptop for gaming with the graphics power full card cost slightly more than £ 600
    If you need to make a decision; You want to buy a gaming laptop and to spend more than £ 600 or you will have a notebook that is ideal for everyday use, like watching DVDs, in collaboration with the office software, etc.

    The Caesar game is unknown to me, but I assume that it doesn t need a graphics card high performance and it should work on a normal phone too.

    I think that a Satellite a200 is not bad choice for you, because some A200 laptop computers were shipped with the Intel Pentium Dual-Core processor and an NVIDIA GeForce graphics card.

    And very important is that all the XP drivers were already released ;)

  • Need help with the curve of a group of objects

    Salvation Group;

    This is my first post in this group. I'm quite new to Adobe Illustrator CS5, and I had to start using it to provide the type of file to a printer for Sublimation in the USA. They use CS5, and all colors are limited to the Pantone Solid Coated for their printing system. I'm swimsuit fabric printing.

    However, my question is probably very basic. It is also frustrating, because I have already successfully did this that I ask, just do not remember how I did it.

    Curved Objects Example.jpg

    In my image, the upper rectangle has curved shape finished (bottom). I've done this before, with in fact several objects together. They all have the curve with the rectangle.

    I tried to do it again, using all kinds of transformation tools (shear), the tools of the effect and everything I could find, but nothing has worked. I thought that maybe to shear would work if I could fix in the middle of the rectangle and shear on both sides of the rectangle to the top, but it does not work. I think I'll start to take notes when I find something that works!

    How this simple curves of single object or group of objects? It can be done, I know!

    Thank you, Tom.

    You can also use the Suspender Warp or distort the Emvelope > make with Warp Arc

    How to apply it

    as individual objects and the other as a group

    As objectrs

    As a group

  • With the help of mark up tools on the second laptop

    I have collaborated with the highlight and sticky notes on my main laptop but now working on my second computer in Italy, which does not seem to have this facility.  Registration details are the same for both machines.  How can I get these tools to continue working on the PDF file?

    Good day Dr. Mittler,.

    Looks like you are using Adobe Reader and you have two different versions on both computers.  Adobe Reader X added sticky notes and highlighter while Adobe Reader 9 tools didn't have this feature.

    I recommend to download and install Adobe Reader X from: http://get.adobe.com/reader/

    Please let us know if we can be of further assistance.

    Kind regards

    David

  • Problem with the text frames and photo...

    I use InDesign CS4 and design of a newsletter. My frames are not stated with the solid lines, but rather with weak points. In addition, they aren't boxes the same real, they have an X, with the top and bottom of the X closed. Is this normal? Things will work correctly as I move forward and begin inserting text, etc. ? I can't find any options to change that and what I tried did not work. Thanks a lot for your help.

    Not a problem at all (well, maybe a little).

    The x' are only the rectangles are created with the Rectangle frame tool, rather than with the Rectangle tool - or, indeed, with the text tool. X definition will disappear as soon as you click with the text tool inside. They must indicate the two different basic objects and can get a different default value object style applied.

    The usual way to draw a framework designated to receive the text is a drag with the text tool.

    The dotted lines can be a problem - which indicates the frames are created on a master page, rather than on the page you are working on. You can not click on type and in a setting which is located in a master page. Must be "freed" first (Ctrl/Cmd + Shift + Double-click, with the black arrow). There are arguments for and against defining managers text on master pages. You'll have to decide for yourself what to use.

    This image shows rectangles and rectangle frames on a master page (left) and "immediately" on a normal page (right):

  • Help with the limits

    OK, so I have a box (40 * 40) which is covered by basic forces (gravity, etc.) and controlled by the left and right of the keyboard keys...

    and a static rectangle which is 450 * 50... So I wrote a simple script to make the box to stop moving in the direction, if the box is in collision with the rectangle...

    This fine all worked but when I add a box rotation stops into thin air because the rectangle has a new width and height...

    Okay so here's the part of the collision script I think I need to change

    var y = this ._y + ySpeed;
    var agree = this ._x + xSpeed;
    var xBoxB1 = _root.line1_mc._x-(line1_mc._width/2);
    var xBoxB2 = _root.line1_mc._x+(line1_mc._width/2);
    var yBoxB1 = _root.line1_mc._y-(line1_mc._height/2);
    var yBoxB2 = _root.line1_mc._y+(line1_mc._height/2);
    If (y + 20 > = yBoxB1 & & y-20 < = yBoxB2 & & agree + 20 > = xBoxB1 & & agree-20 < = xBoxB2) {}
    ySpeed * = - 0.4;
    jumpable = 1;
    } else {}
    ySpeed += gravity;
    jumpable = 0;
    }

    Here is the script in the box 'This' refers to the area and "_root.line1_mc" means the rectangle that has undergone a rotation of 10 degrees... jumpable is a simple variable I've stored to tell weather the box was on the ground (rectangle) or not... and every framework ySpeed is added in FLF box... If it doesn't have sense then I'm sorry, I'm almost confused myself.

    in the conditional statement, I added 20 to the y variable because it is the height of half the box etc...

    So what I need to be able to do, is to know where the rectangle is rather than the box around it? If it makes no sense at all?

    Kudos to anyone who can help me somehow... JAM

    check grant skinner collision detection. Maybe that's all you need:

    http://www.gskinner.com/blog/archives/2005/10/source_code_sha.html

Maybe you are looking for

  • Period with external clock measurement

    Hello I have the USB-6210 and I'm using Labview 8.0. I use the 6210 for period measurement of a signal. I have another card (not OR) I want to synchronize with the 6210. The other card has a clock of 10 MHz with a TTL output. I am trying to use the 1

  • Problem with nested structures event

    Hello I'm rather new to Labview and I wanted to use a structure of nested in one of my programs at the event. However, I seem to fail to do things. I created a minimal example of construction that I use, you will find in the attachment. The idea behi

  • Unable to ping the remote host IP address

    I have a home network with 2 desktop computers, printer, TV and BlueRay attached.  The PC is both XP and members of the same workgroup.  I can't get the connectivity between the PC 2.  With 1 PC, I ping successfully all connected devices, with the ex

  • Distinguish uppercase / lowercase in Datamaps

    Hi allA few problems with the distinction uppercase / lowercase in datamaps in FDMEE.I would change the incoming source data for all uppercase when importing before even using Jython.Tried this (loosely based on the Administrator's guide):inFileName

  • Validation rule is not suitable for the calculated figure

    Hello I want to add a validation rule in my data form. My requirement is in the form of data, I want the value of line 2 should be greater than (value of line 1 * 0.2).Now when I am trying to solve this problem through validation rule I do not find t