A simple Line...

I am very new to the swing enviroment and would be very grateful is someone could show me the simpliest way to create a simple line using the 2D package.
Thank you.

Hi friend.
I suggest that you should search in the forum for similar topics or the internet.
http://java.sun.com/docs/books/tutorial/2d/overview/index.html
http://forum.java.sun.com/thread.jspa?forumID=20&threadID=683873
Good luck with you work ;)

Similar Messages

  • Simple line graph problem

    Hi there,
    I want to create a very simple line graph, containing 1 line. Therefore i create a Graph.LINE_VERT_ABS type Graph and add the data using myGraph.setLocalRelationalData(al ArrayList). This arraylist contains values in the form of
    setname jan 12.2
    setname feb 14.5
    setname march 8.1
    etc
    When i do this, I get the errormessage: "The data has an insufficient number of columns. This graph type requires at least 2 columns of data. The data provided has one column.".
    When i add another dummy value to the arraylist:
    dummy dummya 1
    dummy dummyb 2
    the graph displays correctly, but only with a additional line for the dummy values, also in the Legend.
    What am i doing wrong. Surely it is possible to display just one line in the Graph??
    Any help is appreciated.
    Linda

    In the arraylist, setname identifies a column. By default, columns are plotted as groups, or different points along the horizontal axis. In order to have a line or area graph, you need two groups. The data that you are passing has 1 group and 3 series. You should pass it as follows:
    jan setname 12.2
    feb setname 14.5
    march setname 8.1
    etc.
    Passing data like this will give you three groups (jan, feb, march) and one series (setname).
    By the way, what version of BI Beans are you using and how did find out about setLocalRelationalData? That API was never publicly released. It was replaced by setTabularData (same method renamed) and exposed in 9.0.3.
    BI Beans Product Management

  • HOW TO display a simple line of text if the user isn't logged in and not display it if they are?!?!?

    there must be a way to display a simple line of text (or a link) if the user isn't logged in (as wholesale customer), and not display it if they are?!?!?
    it's a basic kind of <php echo> var type of function.... there must be an equivalent in this BC system..... anyone?!?!?     PLEASE!
    thank you
    Chris.

    ok, after chattting with LIVE SUPPORT i've discovered {module_isloggedin}
    now i just need to integrate it into my Online Store modules!

  • In Preview, the simple line annotation seems to have been removed. When I select the tool, there is an arrow annotation instead of the simple line earlier.

    The simple line annotation in the Preview Application seems to have been replaced rather oddly by an arrow. I wish to use the simple line in a PDF document without an arrow at the end. Its a very important annotation that I use very frequently.

    Choose line width at the top of this pull-down in the Annotate tools. Choose simple lines, right, left or two-way arrows at the bottom of the pull-down...

  • Simple lines now not compiling

    I added the Netbeans profiler to my app this morning. I don't know if that has anything to do with my problem specifically, but for some reason, simple lines that I add in are acting very weird now. For instance, the below line asks for another " )". Without this line, the program compiles fine so I know it's not the result of another () not being closed. Both variables are strings. What am I not seeing?
    System.out.println("Path of " + userURL "is " + pathURL);

    yeah, I can go to every closing bracket in Netbeans and it will highlight the opening one. They are all there. I'll post the if block that I'm referring to to see if someone sees something that I don't:
                                if(tempURL.trim().startsWith(baseURL.toString()) && !tempURL.trim().toLowerCase().endsWith("js") && !tempURL.trim().startsWith("#"))
                                    try
                                        HttpURLConnection con = (HttpURLConnection) pageLinks.getRequest().getURL().openConnection();
    int respcode=con.getResponseCode();
    con.disconnect();
    if (respcode != 200 || respcode != 202)
    FileWriter writer = new FileWriter("Not_Found.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    else
    WebLinkQueue.add(pageLinks[i].getRequest().getURL());
    try
    FileWriter writer = new FileWriter("Processed.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    catch(IOException e)
    logger.debug("Could not write " + userURL + " to not processed file");
    catch(java.net.MalformedURLException me)
    logger.debug("pageLinks HTTPCon block: " + me.getMessage());
    catch(java.io.IOException ie)
    logger.debug("pageLinks HTTPCon block: " + ie.getMessage());
    else if(!tempURL.trim().startsWith("#") && tempURL.trim().startsWith(baseURL.toString()));
    notProcessed.add(pageLinks[i].getRequest().getURL().toString());
    try
    FileWriter writer = new FileWriter("Not_Processed.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    catch(IOException e)
    logger.debug("Could not write " + userURL + " to not processed file");
    else if(!tempURL.trim().startsWith("#")) //error here
    try
    FileWriter writer = new FileWriter("External.txt", true);
    writer.write(System.getProperty("line.separator") + pageLinks[i].getRequest().getURL());
    writer.close();
    catch(IOException e)
    logger.debug("Could not write " + userURL + " to not processed file");

  • I want to make a simple line chart

    i want to make a simple line chart using the data in two nonadjacent columns.
    it seems that the easiest way to do this is to export the sheet to google docs and use THEIR charting, which is a two-click deal.
    is there an easy way to do this in numbers?
    my impression:
    numbers:
    very fancy, super pretty, easy to modify APPEARANCE, difficult to use actual charts. custom paint job on a junker
    googledocs:
    available everywhere, basic, more difficult with actual data flexibility, but you can use what you've got.
    the whole emphasis on numbers seems to be how pretty i can make displays, but not a lot of emphasis on making it easy to make things work.
    can anyone shed some light on how to make this simple instead of pretty?

    You can definitely use the technique I mentioned to order the columns to make it easy to chart:
    Here I created a table (the top one) to hold the original data and make a second table (the lower one) to pull data into two adjacent columns:
    The bottom table, as I said pulls data from the top data table:
    Then highlight the data in the table to chart, and selec the chart type from the menu (I suggest the bar chart which is the first item in the chart tool menu):
    I made up this data and mean it to be no reflection on your running ability 

  • Simple Line Chart - Values over time

    A simple line chart displaying a set of values over time would seem to be a very easy report to design. I'll be darned if I can see how to design it. Can anyone shed some light?
    I have provided links to a report and a spreadsheet which is the report datasource. My actual report will use SQL Server as its datasource. I am providing ths excel based example for the sake of protability.You will need to set the datasource location after saving the files to your hard drive.
    I can get the lines to draw properly, what I cannot figure out is how to specify the datetime values for the x axis. The column I would like to use on the x-axis is called DerivedLoggingTime.
    I'd also like to get control of the logarithmic algorithm used to formulate the y-axis values. I am not always happy with the values that the log algorithm comes up with.
    Any help is greatly appreciated.
    [Link to report|http://www.usol.com/~joe/linechart.rpt]
    [Link to spreadsheet|http://www.usol.com/~joe/AnalysisResults.xls]
    Another discovery while working on this report - our database will be SQL 2008 and  we are making use of the datetime2 datatype. CR appears to be treating this datatype as text. So when working with the SQL based datasource, I had to cast datetime2 columns as datetime in order for CR to see the columns as datetime instead of text. This is fine in this instance because the granularity of the datetime values for this particular report does not require datetime2, but that will not always be the case. CR will need to recognize the new datatype.
    Edited by: Joe Sytniak on Jul 17, 2008 5:37 PM

    Hi Joe,
    The Date Axis Line Chart of the Numeric Axis Type Chart, can be used to display data on a regular interval of days, Months and Years. The information displayed can unfortunately not be more granular that days.
    This type of chart is generally used when the data is recorded on irregular intervals in the database, and to make sense of the information stored it needs to be displayed at regular intervals.
    Since the data stored in your data source seems to be stored every 4 minutes, it will not be necessary to use this type of chart. I will suggest to use the regular line chart instead.
    To create a line chart using your date time field and value:
    1. Select "Chart" under the menu "Insert"
    2. Insert the chart on your report in the desired section.
        ( Group Header # 3 in your case. )
    3. In the "Chart Expert" window, under the tab "Type",
        change the chart type to a line chart by selecting "Line" in
        the "Chart Type" list.
    4. Under the tab "Data", add the database field that contains the Date Time information under the "On change of" list.
    (In your case, add the "DerivedLoggingTime" database field)
    5. To display the data for each minute, select the database fields you just added under the "On Change of" list, and
    click on the button "Order". In the "Chart Sort Order" window,
    select "For each minutes" in the "Section will be printed" drop down list, then click "OK"
    6. Add the field you want to display the value in the "Show Value List", then click "OK"
    Now it will display a line chart as desired, but since there is a lots of data point on your chart, the x axis date time labels will overlap each other. To avoid  this situation, I will suggest to skip labels.
    To format a chart to skip labels:
    1. In the "Preview" tab of the report, select one of the x axis label, and right click on it. In the contextual menu, select "Group (X) Axis Options..."
    2. In the "Group (X) Axis Settings" window, under the tab "Layout", check the option "Skip Group Labels" and set the value to 15 for example.
    Now, it will display the date time label at every 15 data point.
    As for your question on how get control of the logarithmic algorithm used to formulate the y-axis values, we unfortunately do not have much control over it other than:
    - Entering static values, or
    - Checking or Unchecking the option "Use Logarithmic scales"
    The above options are available on the y axis. To change those options:
    1. In the "Preview" tab of the report, select one of the y axis label, and right click on it. In the contextual menu, select "Group (Y) Axis Options..."
    2. In the "Group (Y) Axis Settings" window, under the tab "Scales", you will see the following options:
    - Minimum Values
    - Maximum Values
    - Use Logarithmic scales
    I will suggest to check the option "Use Logarithmic scales"
    Finally, as for the issue you discovered where SQL Server 2008 data type DateTime2 is converted to a string in Crystal Reports 2008, it is important to note that SQL Server 2008 hasn't been released yet, therefore it has not been tested in Crystal Reports 2008. Once SQL Server 2008 is released, I will suggest to test it again using the ODBC driver provided with this new version. 
    At this point I am assuming that this is happening because it is a new data type and an unknown data type get converted to string.

  • Simple line drawing project in swing

    hi folks,
    i want to write a simple line drawing project. it has a JPanel, a JFrame and JButton.
    JPanel and JButton are on JFrame. When Button is clicked,
    a line will be added to JPanel but previous lines which have been added are not removed on JPanel.
    Could you please help me?

    i wrote below codes but it adds first line but when click button �n order to add line, it is not adding line. Please help and thanxs...
    import java.awt.BasicStroke;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.geom.Line2D;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.WindowConstants;
    import javax.swing.SwingUtilities;
    public class NewJFrame extends javax.swing.JFrame implements ActionListener {
         private JButton addButton;
         MainPanel mainPane ;
         public Vector lines ;
         * Auto-generated main method to display this JFrame
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        NewJFrame inst = new NewJFrame();
                        inst.getContentPane().add(new MainPanel(inst.lines));
                        inst.setLocationRelativeTo(null);
                        inst.setVisible(true);
         public NewJFrame() {
              super();
              initGUI();
              lines = new Vector();
              lines.add(0, 30);
              addButton.addActionListener(this);
         private void initGUI() {
              try {
                   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                        addButton = new JButton();
                        getContentPane().add(addButton, BorderLayout.SOUTH);
                        addButton.setText("ADD");
                        addButton.setPreferredSize(new java.awt.Dimension(71, 21));
                   pack();
                   setSize(400, 300);
              } catch (Exception e) {
                   e.printStackTrace();
         @Override
         public void actionPerformed(ActionEvent e) {
              if(e.getSource() == addButton){
                   lines.addElement(Integer.parseInt(lines.get(0).toString())+30);
                   mainPane.repaint();
    class MainPanel extends JComponent {
         Vector tempLines ;
         MainPanel(Vector lines){
              tempLines = lines;
              setBackground(Color.white);
         public void paintComponent(Graphics g) {
              Enumeration enumeration = tempLines.elements();
              while(enumeration.hasMoreElements()) {
                   Integer point = Integer.parseInt(enumeration.nextElement().toString());
                   Line2D line = new Line2D.Double(30, point, 200, point);
         Graphics2D g2d = (Graphics2D)g;
         g2d.setStroke(new BasicStroke(5));
         g2d.draw(line);
    }

  • Help me with a simple line-graph, plzzzzzzzz.

    hi!
    can anyone give me the basic java code to create a simple line graph for my java program output.
    thanks a lot in advance.
    cheers!

    Have a look at the Graphics.drawPolyline() method.
    kind regards,
    Jos

  • Looking for simple line drawing program [Solved]

    I am looking for a simple line drawing program with the following features :
    command-driven ( line, circle, ellips and such commands)
    used commands need to be exportable or copyable
    2D
    a canvas with arbitrary size
    libreoffice Draw, Koffice Karbon and xfig are not suitable for this.
    I have some experience with Autocad, but no access to that anymore.
    Any suggestions ?
    Last edited by Lone_Wolf (2011-04-03 13:34:57)

    keenerd wrote:For really simple stuff (and extremely keyboard driven!) I'll make an SVG by hand.  Any xml aware text editor works great.  The spec is pretty simple.  Use an image viewer that will automatically redraw when the SVG is updated.
    +1 http://www.w3schools.com/svg/tryit.asp? … 1&type=svg
    I think TeX can draw alright.
    A bunch of links - never tried them, don't know if they even work:
    http://www.ribbonsoft.com/qcad.html
    http://www.linuxcad.com/
    http://ipe7.sourceforge.net/
    Last edited by karol (2011-04-03 01:12:44)

  • [SOLVED] pacman.conf simple line error or... ?

    So here's what happened:
    I was trying to enable the [multilib] repository. (As according to https://wiki.archlinux.org/index.php/Multilib).
    Thus, I went ahead and uncommented the following from /etc/pacman.conf:
    [multilib]
    SigLevel = PackageRequired
    Include = /etc/pacman.d/mirrorlist
    To edit /etc/pacman.conf, I used LibreOffice Writer. I saved the file as a .txt document and made sure that it is properly renamed as pacman.conf.
    Next, I went to update pacman's package list by running pacman with the -Sy switch.
    And then, voila:
    # pacman -Sy
    error: config file /etc/pacman.conf, line 1: All directives must belong to a section.
    However, when looking at pacman.conf I don't see any errors in line 1. Nor do I see any problems with directives.
    Here are the contents of pacman.conf:
    http://pastebin.com/raw.php?i=XWh9eagr
    Is there a simple problem with a line in pacman.conf --- or is it because I used LibreOffice Writer instead of Vi? Or?
    Is the answer to this right in front of my nose?
    Thank ya'll..
    Last edited by adamstjohn (2012-12-08 00:31:28)

    adamstjohn wrote:or is it because I used LibreOffice Writer instead of Vi?.
    LibreOffice Writer is a word processor - it will do odd things to your .conf files. Use a text editor. If you don't want to use vi, then use nano, or gedit or anything other than a word processor.
    Moving to NC: not at all related to pacman...

  • Simple lines - double lines ...

    I've been working on Number since yesterday and I must admit, I am globally satisfied with the ergonomic approach of the software. For a Allwithmac user I am for a few years, I found easy to take it in hand ... but one thing frustrated me, just the simple fact that you cannot add double lines on the cell borders.
    Did I miss something?

    coffee,
    If you wish to delete the part of a path that is between its crossing two other paths, you may (Smart Guides are your friends) select the path to cut, click each crossing with the Scissors Tool (Smart Guides say intersect, or anchor if it happens to be at an Anchor Point of the other path) and delete the new cutoff path in between.
    If you just wish to have the doodles appear as if they are on top of one another, you can just give them a fill.
    If you wish to have an outer closed shape with whole/partial doodles inside, you may put the shape on top of all the doodles and Object>Path>Divide Objects Below and delete the cutoffs outside it.
    If you wish something else, do something else.

  • How do I just do a simple line!!

    I feel like an idiot but I just want a simple, easy line. I'm doing a sign in form for my sons school and I just need to do -
    Name_________ Number of Tickets___________
    Of course the line works here when I hold done the key but there are little separations when I do it on Pages. I've tried to click underline and then do the space bar, that doesn't work and please don't tell me to use the shape - line function - getting that thing inserted, sized & placed right makes me crazy!
    THANKS SO MUCH IN ADVANCE!!

    Hi
    nbalette
    Welcome to the forum.
    You want what is called a *Leader tab.*
    Create a tab on your ruler at the end point of the line eg one at the beginning of Number of tickets and at the end of that line then:
    +Inspector > Text > Tabs > Tab stops > Select each > Leader > choose your line+
    Peter

  • Simple line chart formatting problems

    I am using the Visual Studio 2008 version of Crystal reports. I am trying to chart the maximum, minimum, and today's prices for natural gas. I have a sql view to that returns 48 rows of data. I want the legend to be MIN. MAX, NOW and the colors to be  green for MIN, red for MAX and blue for NOW.
    I can not set the legend test, the line color and the x axis labels are not readable. Any suggestions would be helpful.
    This is a example of the data:
    dtContract    Now    MAX    MIN
    5/10    3.975    6.207    3.869
    6/10    4.064    6.307    3.965
    7/10    4.185    6.419    4.082
    8/10    4.28    6.507    4.163
    9/10    4.332    6.56    4.207
    10/10    4.447    6.667    4.314
    11/10    4.827    6.997    4.676
    12/10    5.247    7.387    5.096
    1/11    5.464    7.597    5.316
    2/11    5.433    7.597    5.283
    3/11    5.343    7.427    5.172
    4/11    5.153    6.907    4.947
    5/11    5.17    6.887    4.946
    6/11    5.222    6.977    4.988
    7/11    5.289    7.077    5.053
    8/11    5.341    7.152    5.105
    9/11    5.371    7.182    5.138
    10/11    5.47    7.262    5.235
    11/11    5.722    7.502    5.492
    12/11    6.022    7.797    5.792
    1/12    6.225    8.002    5.995
    2/12    6.167    7.997    5.952
    3/12    5.995    7.767    5.77
    4/12    5.555    7.144    5.335
    5/12    5.555    7.102    5.325
    6/12    5.598    7.182    5.368
    7/12    5.658    7.277    5.428
    8/12    5.711    7.347    5.478
    9/12    5.744    7.377    5.513
    10/12    5.842    7.457    5.613
    11/12    6.082    7.689    5.856
    12/12    6.347    7.979    6.129
    1/13    6.548    8.184    6.333
    2/13    6.503    8.179    6.298
    3/13    6.304    7.949    6.088
    4/13    5.844    7.264    5.621
    5/13    5.821    7.219    5.586
    6/13    5.866    7.304    5.636
    7/13    5.934    7.399    5.706
    8/13    5.989    7.469    5.761
    9/13    6.024    7.499    5.796
    10/13    6.124    7.584    5.906
    11/13    6.364    7.829    6.151
    12/13    6.629    8.119    6.421
    1/14    6.829    8.324    6.626
    2/14    6.789    8.319    6.586
    3/14    6.584    8.079    6.381
    4/14    6.104    7.399    5.901

    Found another work around.

  • How to draw a simple line chart using GRAPH_MATRIX_2D function

    Hello,
    can anyone help me with that function please,
    i couldn't draw a line graph with three data series, i mean with three lines in the graph.
    i want to the chart to be drawn as line graph at the beginning, i shouldn't have to change the chart type later,
    can anybody send me a sample code that does what i want.
    i am expecting your answers,
    thanks.
    Note: all answers will be pointed.

    Hi Ali,
    please refer to my reply [here|Re: drawing 2d line chart problem, urgent please!!!] and skip this thread. This is a copy of the other request.
    Regards
    Matthias

Maybe you are looking for

  • IPhoto/iMovie not showing eligible for update in Mac App Store

    I understand that with the release of Mavericks, anyone with early versions of iWork or iLife apps are able to update to the current version free of charge. I know that this works for the iWork apps but I'm having problems with the iLife apps (iPhoto

  • Passing a parameter to an iView window from a Web Dynpro

    Hello all, I know very little about the portal, and haven't been using Web Dynpro for too horribly long, either, so I'm really not sure what part I'm having a problem with here, so I'm just going to explain the whole scenario the best I can. I have a

  • Adobe Acrobat, Reader and Lifecycle question

    I have forms that I created in Adobe Acrobat and Lifestyle.  The forms are useable by most but, some of my users tat are using Reader 11 are having issues writing to the forms.  The problem is random.  Also my environment includes PC's using Windows

  • Mapping 488.2 errors to NI iberr

    Is there a mapping between iberr and 488.2 standard ESR bits (Command Error, Exec Error, Query Error and Device Err)? How does one relate to another? Does the NI driver set iberr based on the values in ESR? If so, what is done with a 488.1 device whi

  • Mail sender is mixed up

    I have 3 different mail accounts - whatever mail sender i choose, it seems it picks a random one as sender. I think it is new after upgrading to Yosemite. Any suggestions?