How to display a single dot in java?
My teacher ask me to use digital differential analyzer(DDA) routine for rasterizing a line
the problem is i can't use the drawLine() method,i only can draw a lot of dot
so can somebody tell me how to display a single dot????
thanks in advance
In a loop, draw a line with very small difference in x1 and x2 (just a few pixels) so it looks like a dot. Or you can use a dot image and g.drawImage(..). You can also try g.fillOval(..) or fillArc(..)
Similar Messages
-
How to display a single massage to all the page
Hi
I am developing a webportal with jsp. in this website there are two parts one is Admin and another one is End user part. what ever the Admin Publishes from the Admin Part that will be Updated to End user Part.
Now I have 15 pages in the End User Part and at the Admin Part I have One page to Enter the News and Update it in the Database.
I am using java bean to select the News from the Database.
Now my Question is How to display the News to all the 15 is there any simple way to do this or I have to use this
<jsp:useBean id=""portal" scope="request" class="data.portalBean"/>
<jsp:setProperty name="port" property="*"/>
and access the JavaBean method to select the News and display
Please tell me if there is any simple way to do this
Thank you for your help
Cheers
jofinCreate an include page with jsp:useBean and so on and include that page in all 15 pages using jsp:include.
-
How to display a BPEL variable using Java Embedding
Hi, hope someone can help, I'm sure this is something very simple but for the life of me can't seem to find it through the tutorials including the Dev guide.
Question
=======
How can I display user defined and BPEL variables in the process activity "Java Embedding" ?
ex: System.out.println(bpws:getVariableData("myDatabaseParameterVariable")
This example doesn't work but this is basically what I am trying to achieve.
I would appreciate any help with this.
RookieActually that's all the code I have.... System.out.println(myDatabaseArg);
myDatabaseArg is a simple parameter defined in the database adapter configuration wizard which is used as a criteria to retrieve data.
Just before I invoke the Read I use the Java Embedding to display the content of the parameter. -
How to display a .exe file in java applets by avoiding the file downloadbox
Hi sir,
I know that in order to display a any file(or)program in java applets you need to use showDocument().Where you cannot use exec() in java applets.
My problem is that when i use showDocument() to display .exe file.It is showing a file download dialog box.If we click & open only it is opening that .exe file.Here i want to open the .exe file without showing that file download dialog box in java applets.
Since,i am undergoing a project which involves it,it is quite urgent.pls.do provide the exact code in java applet without showing that file download dialog box.If it can't be done pls. do provide any other possibilities in order to be displayed on the browser.Thank U.
Regards,
m.ananthuHi!
I think you it's better to write a server socket program
in server and open a socket connection to server socket then
send exe file content via connection.
(I guess you know applets only have permission to open socket connection to their code base)
Bye! -
How to display images in the Personal Java?
Guys,
please help me to display the images in gif format in the standalone application using PersonalJava.
with regards,
AminJDK:1.1.8; Personaljava:1.1Beta
Following is my program,it can not only display image but also scroll image that biger than Panel or Canvas.
import java.awt.*;
import java.awt.event.*;
//ImageCanvas object is container keeping Image
class ImageCanvas extends Canvas
private Image image,errorimage;
Container pappy;
public ImageCanvas(Image i,Container parent)
errorimage = Toolkit.getDefaultToolkit().getImage("error.gif");
image=i;
pappy = parent;
//following 5 lines can make image display smoothly
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(image, 0);
try { tracker.waitForID(0); }
catch (InterruptedException e) {}
public void paint(Graphics g)
if(image.getWidth(this)==-1)
image=errorimage;
Dimension d = getSize();
this.setSize(image.getWidth(this),image.getHeight(this));
//Critical syntex for refresh container
pappy.layout();
pappy.repaint();
g.drawImage(image, 0, 0,this);
public class ScrollingImage implements ActionListener
{ Frame frame;
ScrollPane sp;
Image im;
public static void main(String[] args)
ScrollingImage tests= new ScrollingImage();
tests.go();
public void go()
frame = new Frame();
frame.setLayout(new BorderLayout());
sp = new ScrollPane();
im =Toolkit.getDefaultToolkit().getImage("001.gif");
//please notice following line,critical syntex to display image,I took 2 days to find it.
sp.add(new ImageCanvas(im,sp));
sp.setSize(240,290);
frame.add(sp, BorderLayout.CENTER);
//following 5 lines make frame be able to close
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.pack();
frame.setVisible(true); -
How to display a single video asset across 3 adjacent panels.
Hi,
How do you apply a single video asset across a number of panels side by side to each other. One of the panels is a drop zone and the others are clones of the drop zone. The clone panels are adjacent to the drop zone and placed at an angle so the video appears across three different surfaces. It's a really cool effect but I can't figure out how to achieve it. Any help appreciated.
DaveI can only guess you're creating the panels by masking the clone layers?
So... create 3 clone layers of the original, and mask each as appropriate to the panel's position?
Patrick -
How to display the single characterstics (top one) wrt key figure
Hi,
I have got a reporting issue like::
Values in Cube-
GL Fiscal year/period Doc no Amount
1 2004.006 1 10000
1 2004.006 2 15000
1 2004.007 3 20000
i want to show in my report as--
1 2004.006 1 10000
1 2004.007 3 20000
i.e it should pick only the first line from cube corresponding to the 2004.006 period..Hi,
You have 2 options
1. you can create a transformation and write a starteroutine so that it takes the first record of the document number. but in practical it is not advisable because the cube contains inconsistant data and you cant develope any other reports on it.
2. Next option is
Step1
You need to write the user-exit to populate Reporting related variables in the Enhancement assignment RSR00001 and select the FM EXIT_SAPLRRS0_001 and then in the include ZXRSRU01 we need to write the code. These are helpful especially we need to derive any varible. (here in your case you can create a customer exit variable for Document number not ready for input)
Along with that:
BEx User Exit allows the creation and population of variables and calculations for key figures and variables on a runtime basis.
Step2
After creating the variable , For populating the values use the Function module RSDPL_CUBE_DATA_READ to read the data for the cube and populate the same into the internal table.
Step3
For the internal table you need to sort the document number and the date so that it picks the top most record in displaying the data. and in the out you will get as you requirement is
1 2004.006 1 10000
1 2004.007 3 20000
Last option but looks silly
Develop one more Cube which is above your existing cube . and develope a start routine which takes the first record from the cube. and now you can develop the report based on the new cube ( in this new cube the data will be there for the first record)
hope this helps
Santosh -
How to display a oracle table from a java program?
How to display a oracle table from a java program.
Hello friends, I have written a Java program, using oracle 10g as backend.
I want to display a oracle table as output. Im not getting how to display oracle table as a output table.. Pls help me
Thank youjayanthds, you're not going to get a satisfactory
answer to this here. it's too big a task to justbe
quickly outlined in a forum - the reply "all youneed
to do is to query you table and return it asJTable"
is worthless, for example, since the solution to
any problem can be distilled to such a
soundbite, if need be. doesn't make the solutionany
simpler
essentially you're asking "how do I write adatabase
application?". all you'll get is snippets of code
that, when fitted together, will eventually helpyou
do this, but you'll spend days and days comingback
saying "right, I've done that, now what?" until
either you or the forum gets frustrated with the
whole affair and the process stops
there are entire books written about this subject,
and countless tutorials and guides on theinternet.
you're better off going down that routehehehe.well, it's true! I used to have a manager that would outline the solution to a problem in a few lines of pseudocode, and then firmly believe that the actual solution would be just as brief and simple. shame his pseudocode included such lofty abstractions as "reformat all data" -
How to display meesage in JSP from DAO.java
Hi all,
I have a Dao.java coding where i have my oracle queries executed.i have separate functions for every query.It should return boolean value.If the 1st functions returns true,then the second function should be called.if it returns false,i have to display some message like "You have received the message already" in my JSP.i use JSP,Servlet and Dao.
How to execute this.How to display the message.Pardon me if its too silly.Help me out guys.
If(true)
call 2nd function
else
display message
}What have you tried?
What happened? -
How to display 7 values of single field in row wise.
hi,
how to display 7 values of single field in row wise.
thankx in advance.hi ,
do it like this :
1 Place ur UI element in tranparent container with Layout as Row Data and Layout Data as Row Head Data
2 Ur first UI , which contains the first value as Row Head Data ,
3 Others as Row Data
u can do it with Matrix Data as well
if u want to give space , u can use HORIZONTAL GUTTER and set its width to medium / large / Xlarge
also there is a UI element "INVISIBLE ELEMENT" ,
1 u can use this UI element to provide space between ur other UI elements in the view
2 u can insert a text element as well , and in the Text property of the element press ALT + 0160.
u can give the space bw UIs as desired.
regards,
amit -
How to display sqlplus result in java?
I want to call sqlplus to execute some sql commands in java,but how can i print the result of sqlplus?
In java code ,i call sqlplus like:
Process p;
//execute the command
p = Runtime.getRuntime().exec(commandString);
//print return result of the command
InputStream inputStream = p.getInputStream();
How to display the execution result?
Edited by: Yi on Feb 26, 2012 11:41 PMYou can use ProcessBuilder. This code launches sql*plus and runs the script in the 'filename' variable. It displays the results in NetBeans console.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import java.util.Map;
public class test1 {
public static void main (String args []) {
test_script();
public static void test_script () {
String fileName = "@test_table.sql";
String sqlPath = "E:\\";
String sqlCmd = "sqlplus";
String arg1 = "user/password@sid"; -- plug in your user, password and db name
String arg2 = fileName;
try {
String line;
ProcessBuilder pb = new ProcessBuilder(sqlCmd, arg1, arg2);
Map<String, String> env = pb.environment();
env.put("VAR1", arg1);
env.put("VAR2", arg2);
pb.directory(new File(sqlPath));
pb.redirectErrorStream(true);
Process p = pb.start();
BufferedReader bri = new BufferedReader
(new InputStreamReader(p.getInputStream()));
BufferedReader bre = new BufferedReader
(new InputStreamReader(p.getErrorStream()));
while ((line = bri.readLine()) != null) {
System.out.println(line);
bri.close();
while ((line = bre.readLine()) != null) {
System.out.println(line);
bre.close();
System.out.println("Done.");
catch (Exception err) {
err.printStackTrace();
}Here is the contents of the script placed at E:\\test_table.sql
Prompt drop TABLE ANOTHER_TEST;
DROP TABLE ANOTHER_TEST CASCADE CONSTRAINTS
Prompt Table ANOTHER_TEST;
CREATE TABLE ANOTHER_TEST
BATCH_SEQ NUMBER,
BATCH_GROUP_ID NUMBER,
STATUS_FLAG VARCHAR2(30 BYTE),
OBJ_BEING_PROCESSED VARCHAR2(80 BYTE),
BATCH_RUN_START_DTTM DATE,
BATCH_RUN_END_DTTM DATE,
CREATE_DTTM DATE,
CREATE_USER VARCHAR2(30 BYTE),
UPDATE_DTTM DATE,
UPDATE_USER VARCHAR2(30 BYTE)
LOGGING
NOCOMPRESS
NOCACHE
PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
MONITORING
COMMENT ON TABLE ANOTHER_TEST IS 'This is a test table.'
EXIT
/ -
hello everybody. this is my first time i post a qestion and i hope that you will help me. I started to make a project where I have to display video when I choose from a combo box.
I had two problems is how to display in arabic and I solved this problem.
Second problem what pakage I need? I knew that I have to you class Player from package media?
my question is how to download this pakage?and do I have to download JFM or other pakages.JMF download & installation instructions are available at
http://java.sun.com/products/java-media/jmf/2.1.1/download.html
JavaDocs for JMF2.1.2 at
http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/
Also download & read the JMF2.0 API Guide available at
http://java.sun.com/products/java-media/jmf/2.1.1/specdownload.html -
How can i merge javafx code and java fxml code in a single project
how can i merge javafx code and java fxml code in a single project.
Please let me Know as soon as possible.Everything that it is possible to retrieve from a class file can be deduced from the class file definition.
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html
Sylvia. -
How to display value from java class with output generated with toplink
i hava a requirement of displaying (distance ie calculated in java class) with output generated by query.
ie if output is like
school name (distance)
physical address
here the school name and physical address are retrived from database.Hi,
ValueHolders are used by the JSF internal framework. To work with an object (attributes) in a managed bean you don't need to make it returning a value holder.
Create a POJO, provide accessor methods and register it as a managed bean. Access it from JSF with EL
Frank -
How to display multiple data from different table in one table? please help
Hi
I got sun java studio creator 2(the separate installation not the one in the net beans)....
My question is about displaying data that have been taken from the database.... I know how to display data in a table(just click on the table "bind data" )... but my question is that:
when i want to use a sql statement that taken the data from different table...
how can i display that data in the table(that will be shown in the web) ??? when i click bind data on the table i can only select one table i can't select more than one....
Note:
1) i'm using the rowset for displaying the data in the table, since the sql statement is depending on a condition(i.e. select a from b where c= ? )...
2) i mean by different table is that( i.e. select a from table1,table2 )..
thanks in advance...Hi,
937440 wrote:
Hi every one, this is my first post in this portal. Welcome to the forum!
Be sure to read the forum FAQ {message:id=9360002}
I want display the details of emp table.. for that I am using this SQL statement.
select * from emp where mgr=nvl(:mgr,mgr);
when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
1)I want to display all the records when I won't give any input including nulls
2)I want to display all the records who's mgr is null
Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
SELECT *
FROM emp
WHERE LNNVL (mgr != :mgr)
;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
SELECT *
FROM emp
WHERE :mgr = mgr
OR :mgr IS NULL
;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
SELECT *
FROM emp
WHERE DECODE ( mgr
, :mgr, 'OK'
) = 'OK'
;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.
Maybe you are looking for
-
Windows 7 64 bit on Early Mac Pro
I finally got Win 7 64 bit installed on early Mac Pro. However, I have one significant issue remaining. I have an Apple Cinema 23 connected via ADC to DVI adapter; my video card is a Nvidia Quadro FX 4500. I can boot into Safe Mode without problem si
-
Kernal Panic, Finder Crashing, Overall poor Performance
I've had the Finder crash a ton lately. I've done an erase and install, no change. Got a Kernal Panic 2 days after the erase and install while installing Logic Pro. Talked to a Genius, could be hard drive, ram, Logic Board. I have a Console log from
-
A/r Invoice- Service Module
Hi, Iam unable to raise an Invoice from the Service Module. All the row fields appear disabled. Any answers
-
I have a few technical questions on Safari 4!
*Keyboard Shortcuts* How do I set these? *Smooth scrolling* I am using the Windows version of Safari 4. Is there a way to enable smooth scrolling?
-
Even though I have checked "Automatically open all supported TIFF's" in Camera RAw Preferences - My tiff files do not open up in camera RAW - PS 6