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);
}
Similar Messages
-
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] terminals & line drawing characters problem
I use quite some escape sequences in my bash prompt, amongst them a few that produce line drawing characters. Works fine in the virtual consoles (tty), but no terminals in X (tried xterm, terminal, urxvt) display them correctly, for some reason. My locale settings seem fine, and I've tried various fonts (including the one I use in the virtual consoles).
What could the issue be?
FYI, my bash prompt variable. Does it display correctly for you?
DRED='\e[0;31m'
DGREEN='\e[0;32m'
DYELLOW='\e[0;33m'
DBLUE='\e[0;34m'
DPURPLE='\e[0;35m'
DCYAN='\e[0;36m'
DWHITE='\e[0;37m'
LRED='\e[1;31m'
LGREEN='\e[1;32m'
LYELLOW='\e[1;33m'
LBLUE='\e[1;34m'
LPURPLE='\e[1;35m'
LCYAN='\e[1;36m'
LWHITE='\e[1;37m'
COLRESET='\e[0m'
PS1="\n\[$DBLUE\]\[\016\]l\[\017\]\[$DRED\](\u@\h)\[$DBLUE\]\[\016\]qqq\[\017\](\[$LBLUE\]H\!\[$DBLUE\])\[\016\]qq\[\017\](\[$LBLUE\]C\#\[$DBLUE\])\[\016\]qq\[\017\](\[$LBLUE\]J\j\[$DBLUE\])\[\016\]qqq\[\017\](\[$LBLUE\]\D{%H:%M %A %d - %B %Y}\[$DBLUE\])\n\[\016\]t\[\017\]\[\016\]q\[\017\](\[\[$LBLUE\]\w\[$DBLUE\])\n\[\016\]mqq\[\017\]> \[$LBLUE\]"
Last edited by Mzg (2010-07-09 10:00:41)After some detective work I have managed to come up with an explanation as well as what seems to be a working solution.
If you have not tried the prompt above, basically I tried to use some line drawing characters in my bash prompt, but these refused to display correctly under any X terminals I tried (though it looked fine on virtual consoles).
The problem was in the
\[\016\] ... \[\017\]
sequences. The \016 escape sequence is supposed to enter the alternate character set mode (common way to draw e.g. lines in text mode) while \017 returns the terminal to the standard character set. These work fine on the virtual consoles, but are apparently a no-no in (some) X terminals. If you tried the prompt you would notice that the color escape sequences worked fine, only the line drawing characters failed.
So that is the explanation part. So for the solution...
For urxvt, which is my preferred terminal emulator, the solution is quite simple. This should also work with other rxvt-derived terminals (including the popular aterm), though I have not tested this.
These terminals offer the same functionality as the virtual consoles, though the escape sequences are different. "\033(0" enters alternate charset mode while "\033(B" returns to standard charset mode. So the solution is simply to replace all previous
\[\016\] ... \[\017\]
sequences with
\[\033(0\] ... \[\033(B\]
But this poses a problem, as the virtual consoles do not recognize these sequences and you'll get the same problem as before, only in text mode instead of X. I solved this by using the PROMPT_COMMAND variable to run fgconsole every time a command is ran in bash, checking if the command is ran in tty7 (i.e. X11) or in one of the (other) virtual consoles. This is my code for the root prompt:
DRED='\e[0;31m'
DGREEN='\e[0;32m'
DYELLOW='\e[0;33m'
DBLUE='\e[0;34m'
DPURPLE='\e[0;35m'
DCYAN='\e[0;36m'
DWHITE='\e[0;37m'
LRED='\e[1;31m'
LGREEN='\e[1;32m'
LYELLOW='\e[1;33m'
LBLUE='\e[1;34m'
LPURPLE='\e[1;35m'
LCYAN='\e[1;36m'
LWHITE='\e[1;37m'
COLRESET='\e[0m'
function prompt_func
# Running in tty7 or larger (X11)
if [ `sudo fgconsole` -gt 6 ]
then
PS1="\n\[$DBLUE\]\[\033(0\]l\[\033(B\]\[$DRED\](\u@\h)\[$DBLUE\]\[\033(0\]qqq\[\033(B\](\[$LBLUE\]H\!\[$DBLUE\])\[\033(0\]qq\[\033(B\](\[$LBLUE\]C\#\[$DBLUE\])\[\033(0\]qq\[\033(B\](\[$LBLUE\]J\j\[$DBLUE\])\[\033(0\]qqq\[\033(B\](\[$LBLUE\]\D{%H:%M %A %d - %B %Y}\[$DBLUE\])\n\[\033(0\]t\[\033(B\]\[\033(0\]q\[\033(B\](\[\[$LBLUE\]\w\[$DBLUE\])\n\[\033(0\]mqq\[\033(B\]> \[$LBLUE\]"
else
PS1="\n\[$DBLUE\]\[\016\]l\[\017\]\[$DRED\](\u@\h)\[$DBLUE\]\[\016\]qqq\[\017\](\[$LBLUE\]H\!\[$DBLUE\])\[\016\]qq\[\017\](\[$LBLUE\]C\#\[$DBLUE\])\[\016\]qq\[\017\](\[$LBLUE\]J\j\[$DBLUE\])\[\016\]qqq\[\017\](\[$LBLUE\]\D{%H:%M %A %d - %B %Y}\[$DBLUE\])\n\[\016\]t\[\017\]\[\016\]q\[\017\](\[\[$LBLUE\]\w\[$DBLUE\])\n\[\016\]mqq\[\017\]> \[$LBLUE\]"
fi
PROMPT_COMMAND=prompt_func
Note that I do not claim to be a good bash programmer, so there might be better ways. This has however worked flawlessly so far, including when su'ing to other users, and switching between tty's and X.
The code is the same for my other users, except from the colors. Note the
`sudo fgconsole`
Sudo proved necessary for non-root users. I added an entry in the sudoers config file to let all users run fgconsole as root without providing a password.
Okay, that's it. It's a bit dirty, but it solved my problem at least.
Last edited by Mzg (2010-07-10 07:06:44) -
Unicode line-drawing characters - possible Java bug?
Hi all, I am trying to draw a box using line drawing characters in UTF-8. I make the UTF-8 box file in Microsoft Word where it looks aligned. However, when I run my Java program to display the box in a JTextArea, it is all out of alignment like below. Is this a bug in Java that prevents it from displaying aligned line-drawing characters? I am tearing my hair out over this so your help is much appreciated.
Regards,
Rianmal.
╔═══════════════════╗
║║║║║║║║║║║║║║║║║║║║║
║ ║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║
╚═══════════════════╝sabre,
Looks like monospaced isn't found on windows (vista)... So I used "Courier New" instead.
Sabre20090412a.java is saved with encoding=UTF-8 (i.e. CP1252) instead of the default ASCII, which doesn't support the extended characters.
package forums;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class Sabre20090412a
private static final String text;
static {
String t;
t = "╔═══════════════════╗\n"; // LINE 12
t += "║║║║║║║║║║║║║║║║║║║║║\n";
t += "║ ║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "║∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙║\n";
t += "╚═══════════════════╝\n"; // LINE 23
text = t;
public static void createAndShowGUI() {
final JFrame frame = new JFrame("Test");
final JTextArea ta = new JTextArea();
ta.setFont(new Font("Courier New", Font.PLAIN, 14)); // <<<<< Note font-name="Courier New"
ta.setText(text);
frame.setContentPane(ta);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
build (NOTE the -encoding utf-8)*
cd /d C:\Java\home\src\forums
"C:\Program Files\Java\jdk1.6.0_12\bin\javac.exe" -encoding utf-8 -Xlint -d C:\Java\home\classes -cp c:\java\home\src;.;C:\Java\home\classes C:\Java\home\src\forums\Sabre20090412a.java
run
cd /d C:\Java\home\src\forums
"C:\Program Files\Java\jdk1.6.0_12\bin\java.exe" -cp C:\Java\home\classes forums.Sabre20090412a
References:
http://www.google.com/search?q=warning%3A+unmappable+character+for+encoding+Cp1252&hl=en
http://en.wikipedia.org/wiki/Windows-1252 #says 1252== IANIA UTF-8 except
http://www.utf8-chartable.de/unicode-utf8-table.pl #page for 2500 onwards
http://forums.sun.com/thread.jspa?threadID=5185338 #-encoding
http://www.java2s.com/Code/Java/2D-Graphics-GUI/Listallavailablefontsproviedinthesystem.htm
Roedy Green rocks!
http://mindprod.com/jgloss/font.html#AVAILABLEJ
http://mindprod.com/applet/fontshower.html
Thanx for the fish!
Cheers. Keith. -
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 PMHi 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. -
Can aperture 3 convert a gray scale photo into a line drawing?
can aperture 3 convert a gray scale photo into a line drawing?
I have a B.F.A. degree in painting which educated me in the "history of art" with appreciation of the old masters. I agree with your statement that, "anyone mistaking photos converted to "line drawings, watercolors,or paintings" is simply ignorant" and that, "line art is to drawing what clip art is to painting."
I appreciate your passion and love for keeping "visual creativity" true to its inherant nature. Expressing your views however, in regard to my question in this thread, is irrelevant to the question asked. I am not ignorant. My question has nothing to do with the philosophy of art. You have no idea what project I have in mind for asking my original question. I suggest that perhaps you have chosen the wrong forum to express your views. Sticking to the question asked, as the other participants have, has been most helpful to me and I appreciate their response.
Thanks for your attention. -
Adobe is great software but has anyone else noticed that Corel has a better line drawing tool?
Adobe is great software but has anyone else noticed that Corel has a better line drawing tool? I end up doing all my line drawing in Corel because it is so simple and then importing it into adobe. You would think, with all these updates that they are constantly doing Adobe would think to simplify it's pen tool. I'm talking about the pen tool in illustrator. Don't even get me started on the bloody rubbish pen tool they've got in photoshop. It makes deep etching something properly a really agonising task.
I'm not sure that I followed everything, but you got a replacement phone and continue to experience problems? It sounds like a logical move would be to have AT&T replace your SIM card. I would doubt that the size/fit is an issue, these things are a standard size, but replacing the SIM will have an impact on the network set-up that might be the root cause.
-
Code of line drawing algorithm
anybody can tell me code of line drawing algorithm..if i hav two points a(x1,y1) and b(x2,y2) then
how kan i draw line using these points..Use drawLine(int x1, int y1, int x2, int y2).
As I understand it you should only do the drawing in a paint method (or paintComponent method if you're using swing.) If you're wanting the lines to be "permanent" then draw to a drawing.
e.g. from a Logo/Turtle prog that I'm working on:
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if ( ! initDone ) {
i_drawing = (BufferedImage)createImage(700,500);
g_drawing = i_drawing.createGraphics();
initDone=true;
if (penDown && drawOp) {
g_drawing.drawLine((int)posX, (int)posY, (int)targX, (int)targY);
drawOp = false;
g.drawImage(i_drawing, 0, 0, this);
posX = targX;
posY = targY;
This draws the line on the image (i_drawing) and then displays the image.
Hope this helps. -
Curious font name..., 'Reveal Line Draw'?
Hello there.
I just wrote a GUI program which displays fonts and some rendered images for styles.
And I got a font named 'Reveal Line Draw'.
What is it? Is it just an instance of valid font?
Maybe my question can be 'Revealed' as one as some stupid... :)
Here comes my source code.
Please try to compile it and run it.
And, maybe, you can find that thing.
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JRootPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
public class FontViewer {
public static void main(String[] args) {
final String[] fontFamilyNames = GraphicsEnvironment.
getLocalGraphicsEnvironment().
getAvailableFontFamilyNames();
final String[] columnNames =
{"NAME", "PLAIN", "BOLD", "ITALIC", "BOLD ITALIC"};
new JFrame("Font Viewer") {
@Override
protected JRootPane createRootPane() {
return new JRootPane() {
@Override
protected Container createContentPane() {
return new JScrollPane(new JTable() {
protected TableModel createDefaultDataModel() {
return new AbstractTableModel() {
@Override
public Class getColumnClass(
int columnIndex) {
return Font.class;
@Override
public String getColumnName(int column) {
return columnNames[column];
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return fontFamilyNames.length;
public Object getValueAt(int rowIndex,
int columnIndex) {
return null;
@Override
protected void createDefaultRenderers() {
super.createDefaultRenderers();
defaultRenderersByColumnClass.put(
Font.class, new DefaultTableCellRenderer() {
@Override
public Component
getTableCellRendererComponent(
JTable table, Object value,
boolean isSelected,
boolean hasFocus, int row,
int column) {
Font font =
Font.decode(fontFamilyNames[row]);
Component renderer =
super.getTableCellRendererComponent(
table, font.getName(),
isSelected, hasFocus, row,
column);
if (column == 1) {
renderer.setFont(font.deriveFont(
Font.PLAIN));
} else if (column == 2) {
renderer.setFont(font.deriveFont(
Font.BOLD));
} else if (column == 3) {
renderer.setFont(font.deriveFont(
Font.ITALIC));
} else if (column == 4) {
renderer.setFont(font.deriveFont(
Font.BOLD|Font.ITALIC));
return renderer;
@Override
protected void processWindowEvent(WindowEvent we) {
super.processWindowEvent(we);
if (we.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
@Override
public void frameInit() {
super.frameInit();
setSize(600, 400);
}.setVisible(true);
}Here are my printed font names. And I just wanna know what the bolded font works for?
Acutally it doesn't show any renderred image on my source.
WindowsXP SP2 JRE 1.5.0U5
Agency FB
Arial
Arial Black
Arial Narrow
Arial Rounded MT
Batang
BatangChe
Blackadder ITC
Bodoni MT
Bodoni MT Black
Bodoni MT Condensed
Book Antiqua
Bookman Old Style
Bookshelf Symbol
Bradley Hand ITC
Calisto MT
Castellar
Century Gothic
Century Schoolbook
Comic Sans MS
Copperplate Gothic
Copperplate Gothic Light
Courier New
Curlz MT
Dialog
DialogInput
Dotum
DotumChe
Edwardian Script ITC
Elephant
Engravers MT
Eras Bold ITC
Eras Demi ITC
Eras Light ITC
Eras Medium ITC
Estrangelo Edessa
Felix Titling
Forte
Franklin Gothic Book
Franklin Gothic Demi
Franklin Gothic Demi Cond
Franklin Gothic Heavy
Franklin Gothic Medium
Franklin Gothic Medium Cond
French Script MT
Garamond
Gautami
Georgia
Gigi
Gill Sans MT
Gill Sans MT Condensed
Gill Sans MT Ext Condensed
Gill Sans Ultra
Gill Sans Ultra Bold Condensed
Gloucester MT Extra Condensed
Goudy Old Style
Goudy Stout
Gulim
GulimChe
Gungsuh
GungsuhChe
Haettenschweiler
Impact
Imprint MT Shadow
Kartika
Latha
Lucida Bright
Lucida Console
Lucida Sans
Lucida Sans Typewriter
Lucida Sans Unicode
Maiandra GD
Mangal
Marlett
Microsoft Sans Serif
MingLiU
Monospaced
Monotype Corsiva
MS Gothic
MS Mincho
MS Outlook
MS PGothic
MS PMincho
MS Reference Sans Serif
MS Reference Specialty
MS UI Gothic
MV Boli
NSimSun
OCR A Extended
Palace Script MT
Palatino Linotype
Papyrus
Perpetua
Perpetua Titling MT
PMingLiU
Pristina
Quest Font
Raavi
Rage
Reveal Line Draw <<<<<<<<<<<<<<<< @@?
Rockwell
Rockwell Condensed
Rockwell Extra
SansSerif
Script MT
Serif
Shruti
SimHei
SimSun
Sylfaen
Symbol
Tahoma
Times New Roman
Trebuchet MS
Tunga
Tw Cen MT
Tw Cen MT Condensed
Tw Cen MT Condensed Extra
Verdana
Vrinda
Webdings
Wingdings
Wingdings
Wingdings
ZWAdobeF -
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 ;) -
i have a line drawing (black on white paper) i have scanned and need to make the white paper transparent, maintaining the line drawing, can i and then HOW can i do this in PS? this is for my business logo. ive used it for years but with a solid background. id like to have it just be the drawing over my photos with a transparent background.
First let me apologize for posting a reply that was only suitable for advanced users. Photoshop is broad and powerful therefore has a huge learning curve. In fact I would state no one knows and uses all of Photoshop. When we first get Photoshop it intimidate us and we're very uncomfortable using it. Many thing are not intuitive there in much learning involved. After some time we begin to know something and we are able to do some thing. Learning become rapid and we start playing in Photoshop. It is very important to play with Photoshop. Playing with Photoshop and asking for help with in forums like this IMO is the best way to learn.
Photoshop Power lies in layers, selection and automation. However it takes knowledge to use photoshop well so most powerful tool you have ins Photoshop is the gray matter between your ears. Most at one time or another want to watermark or put a logo on their image. So its best to automate this process. All run into a problem in the process. "Size" We find our assets vary in size and aspect ratios. Landscape, Portraits, Panoramas and others. This complicates automation. Vector graphics works best when size vary greatly. If you can not work out how to create a vector solution like a custom shape. Create your Logo and watermark large thing scale down better the up. Text scale well for text uses vectors graphics however if you rasterize text it will not scale well.
I do not type or do English well so let me do some screen captures. I can not stress enough how important Black, White, Grays and Blending is when it come to image processing. Become friends with Multiply, Screen, Overlay and Luminosity blending.....
However when there is a white or black background though you can blend them you can not add a style like a drop shadow, emboss or make it invisible setting fill to 0 so only the style is visible. When there is contrast between the logo and background it is easy to separate the two. To select the background and delet it to have the logo with a transparent background. Many tools can be used to create the selection hee I use my action kill white.
Vector Shape would work better for scaling However it would be best to create the logo from scratch in a vector program like illustrator but I never had the resources to justify the Creative suite. I only had Photoshop. Recently Adobe gave me and other a year subscription to the creative suite for our participation here. I still have not installed anything but Photoshop, A while back I found a program that can create vector patf for black and white art work. It will not be as good as using something like illustrator. However vector paths can be edited in Photoshop and cleaned up some. Here is the PSD it 13MB because od the gradient http://www.mouseprints.net/old/dpr/AmPm24-7.psd -
JSP does not have visibility of java classes in simple Web Module Project
Dear Experts
I am developing what I thought would be a very simple Web Module Project for a simple webservice
to allow a user to logon to Netweaver Portal with a simple logon and password.
I have not done this in over 8 years, and am somewhat rusty.
The webservice is package in a .war and is deployed via an Enterprise Application project as a .ear.
The issue I am having is that I want to enhance the presentation of the webservice through the
provision of css and adding a couple of images. The "libraries" are visibile in the build path of web
module project.
At the top of my .jsp for logon form I want to import some java libraries in order
to get String webpath = componentRequest.getWebResourcePath()"/":
<%@ page session = "true"%>
<%@ page import = "com.sapportals.portal.prt.resource.IResource" %>
<%@ page import="com.sap.security.core.sapmimp.logon.SAPMLogonLogic" %>
<%@ page import="com.sap.security.core.sapmimp.logon.SAPMLogonCertLogic" %>
<%@ page import="com.sap.security.core.logonadmin.IAccessToLogic" %>
<%@ page import="com.sap.security.core.logonadmin.ComponentAccessToLogic" %>
<% IAccessToLogic proxy = new ComponentAccessToLogic (componentRequest, aResponse, IAccessToLogic.ENV_LOGONCOMPONENT);
final boolean inPortal = true;
String webpath = componentRequest.getWebResourcePath()"/";
// todo: find layout schema...
aResponse.addResource(componentRequest.getResource(IResource.CSS, "css/main2.css"));
%>
However, during runtime the libraries are unknown and I get the following SAPJ2 EE errors
indicating the methods etc are not known to the jsp:
Full Message Text
application [ctxhrofm] Processing HTTP request to servlet [jsp] finished with error.
The error is: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation rocess: [/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java22: package com.sapportals.portal.prt.resource does not exist
import com.sapportals.portal.prt.resource.IResource;
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:23: package com.sap.security.core.sapmimp.logon does not exist
import com.sap.security.core.sapmimp.logon.SAPMLogonLogic;
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:24: package com.sap.security.core.sapmimp.logon does not exist
import com.sap.security.core.sapmimp.logon.SAPMLogonCertLogic;
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:25: package com.sap.security.core.logonadmin does not exist
import com.sap.security.core.logonadmin.IAccessToLogic;
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:26: package com.sap.security.core.logonadmin does not exist
import com.sap.security.core.logonadmin.ComponentAccessToLogic;
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:60: cannot resolve symbol
symbol : class IAccessToLogic
location: class jsp_LoginForm1310122356593
IAccessToLogic proxy = new ComponentAccessToLogic (componentRequest, aResponse, IAccessToLogic.ENV_LOGONCOMPONENT);
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:60: cannot resolve symbol
symbol : class ComponentAccessToLogic
location: class jsp_LoginForm1310122356593
IAccessToLogic proxy = new ComponentAccessToLogic (componentRequest, aResponse, IAccessToLogic.ENV_LOGONCOMPONENT);
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:60: cannot resolve symbol
symbol : variable componentRequest
location: class jsp_LoginForm1310122356593
IAccessToLogic proxy = new ComponentAccessToLogic (componentRequest, aResponse, IAccessToLogic.ENV_LOGONCOMPONENT);
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:60: cannot resolve symbol
symbol : variable aResponse
location: class jsp_LoginForm1310122356593
IAccessToLogic proxy = new ComponentAccessToLogic (componentRequest, aResponse, IAccessToLogic.ENV_LOGONCOMPONENT);
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:60: cannot resolve symbol
symbol : variable IAccessToLogic
location: class jsp_LoginForm1310122356593
IAccessToLogic proxy = new ComponentAccessToLogic (componentRequest, aResponse, IAccessToLogic.ENV_LOGONCOMPONENT);
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:63: cannot resolve symbol
symbol : variable componentRequest
location: class jsp_LoginForm1310122356593
String webpath = componentRequest.getWebResourcePath()"/";
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:66: cannot resolve symbol
symbol : variable IResource
location: class jsp_LoginForm1310122356593
aResponse.addResource(componentRequest.getResource(IResource.CSS, "css/main2.css"));
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:66: cannot resolve symbol
symbol : variable componentRequest
location: class jsp_LoginForm1310122356593
aResponse.addResource(componentRequest.getResource(IResource.CSS, "css/main2.css"));
^
/usr/sap/SQ1/JC20/j2ee/cluster/server3/apps/com.shell/sp~ctxhroap/servlet_jsp/ctxhrofm/work/jsp_LoginForm1310122356593.java:66: cannot resolve symbol
symbol : variable aResponse
location: class jsp_LoginForm1310122356593
aResponse.addResource(componentRequest.getResource(IResource.CSS, "css/main2.css"));
^
14 errors
Exception id: [0019996862AA007E00000436000077FB0004A78CA1BA8324]
I have added the associated DCs for classes to used DCs and they are visible on the buildpath
of my webservice.
What am I missing?
Many thanks for any advice offered
MikeHave you made runtime references to used libraries...?
refer page 20 ...in
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b7199b?quicklink=index&overridelayout=true -
I tried to import a PDF of a line drawing into Photoshop Elements. The thumbnail looks fine, but when imported the file is empty. This used to work in the past. What is wrong and how do I solve this?
Hi
The value of the Channel Strip volume etc is not stored within the C Strip setting, as you have discovered.
If you really wanted, you could add a Gain plug to the strip, with it set to give the correct output level with the Fader set to 0
(Or just set the fader manually in MS)
CCT -
Creating Asset Lines from Projects
Hi All,
We have transactions recorded in Projects module which need to be sent to assets module for creation of assets
However, the problem here is that they need to create many asset lines from one transaction (400-500 asset lines)
Users have been manually completing information required to create asset lines from projects module and running the program to transfer to assets module
In this case there are too many lines to create manually,
Is there any workaround to this issue?
Can the lines be transferred to assets module and then split on the prepare mass additions form? If so, can you please let me know the details, to transfer the line as a "multi-unit" line so it can be split on the mass additions form
Thanks!I was thinking just that conroy, attached is a crop of the type of the black and white scan I'm working with, this was originally a trace, it is a very large document this is just one part of it.
Thanks Noel I did mess around with your suggestions, not sure I achieved what I was after, it was either too strong removing everything or too weak.
What I'm trying to do is get rid of the speckle (despeckle filter cleans it a little) and just have all the lines nicely redrawn and crisp. I've so far being doing it manually but it is 1) inaccurate and 2) taking me a very long time. -
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.
LindaIn 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
Maybe you are looking for
-
Shared Variable Alias vs Programmatic Assignment, which is better?
Hello, I am programming an application for a cRIO platform using the scan engine in LV2009SP1. I'd like to use the cRIO as a standalone controller, and only connect a computer to it occasionally to download data. I decided to do this using shared v
-
Business partner "ID" does not exist in role Sold-To Party
Hello everybody! We have already set up a Group in CRM, but when we use the "Relationships" Assignment Block and click to "New" button and add a Relationship and a Partner we get the error "Business partner "ID" does not exist in role Sold-To Part
-
I am creating an Apple book of photos using iPhoto and a panoramic image.
I am creating an Apple book of photos using iPhoto. I have a panoramic image that I have split into two 9.5X2.583 in pieces in PhotoShop. I want to paste them into facing pages. When I try to move the images to the book I get images much larger wh
-
hi sap gurus. i wanted to change the date of joining of an employee(assue that an employee is already hired in to the system from 1980. only hiring action has been taken place no pay roll has been run.) in this case i want to change that empl
-
In PA30 if we switch on the object manager, we get a section in the left hand side "Find by". Here we get only "Person" and under it "Collective search help", "Search Term" and "Free Search". How can we add other objects in this section like Organiza