PLS give me a smal drawing
Hello,
Please, give me a pice of code, with a shape on a JFrame(in an application) +an button and a window which will pop up when the button is presed. I'd like also the window to have a shape on it.
THX
THX for answered me.
I think I've solved the problem, myself.
THX all.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Test{
public static void main(String[] args){
JFrame myf=new JFrame("TEST Frame");
JButton b1=new JButton("Exit");
JButton b2=new JButton("DEAL");
JPanel p=new JPanel();
Exit al=new Exit();
Deal dl=new Deal();
b2.addActionListener(dl);
b1.addActionListener(al);
p.add(b1);
p.add(b2);
myf.getContentPane().add(p,BorderLayout.CENTER);
myf.setSize(200,200);
myf.setVisible(true);
class Exit implements ActionListener{
public void actionPerformed(ActionEvent e){
int conf=JOptionPane.showOptionDialog
(null,"Relly Exit ?","Exit Confirmation ",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,null,null,null);
if(conf==0)System.exit(0);
class Deal implements ActionListener{
public void actionPerformed(ActionEvent e){
final JWindow myw=new JWindow();
myw.getContentPane().add(new Pan(), BorderLayout.CENTER);
JButton b3=new JButton("Bye !");
ActionListener mm=new ActionListener(){
public void actionPerformed(ActionEvent e){myw.dispose();}};
b3.addActionListener(mm);
myw.getContentPane().add(b3, BorderLayout.SOUTH);
myw.setSize(200,200);
myw.setLocation(500,300);
myw.setVisible(true);
class Pan extends JPanel{
public Pan(){
super();}
public void paintComponent(Graphics g){
super.paintComponents(g);
Graphics2D g2 = (Graphics2D) g;
g2.setPaint(Color.red);
g2.setStroke(new BasicStroke(4));
g2.drawOval(50, 30, 30, 30);
g2.drawOval(100, 30, 30, 30);
g.fillOval(60,45,10,10);
g.fillOval(110,45,10,10);
g2.setStroke(new BasicStroke(6));
g2.drawArc(40,60,100,50,-10,-160);
Similar Messages
-
Hello
PLS give me a small pice of code with a JFrame(in an application) which will have a button and a simple shape(an circle for ex.), (no complicate Layouts, whith setLayout(new FlowLayout()); for ex.).
I'd like that when the button is presed a window( IJFrame, enithing) to come up,and to show an design (another simple drowing).
All exemple keep it so simple as it's posible.
My problem is that I can't figure out drawings whith applications (it works well with JApplets).
THX
P.S.
Sorryt about my English.THX for answered me.
I think I've solved the problem, myself.
THX all.
package stefanberbece.dealB;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Test{
public static void main(String[] args){
JFrame myf=new JFrame("TEST Frame");
JButton b1=new JButton("Exit");
JButton b2=new JButton("DEAL");
JPanel p=new JPanel();
Exit al=new Exit();
Deal dl=new Deal();
b2.addActionListener(dl);
b1.addActionListener(al);
p.add(b1);
p.add(b2);
myf.getContentPane().add(p,BorderLayout.CENTER);
myf.setSize(200,200);
myf.setVisible(true);
class Exit implements ActionListener{
public void actionPerformed(ActionEvent e){
int conf=JOptionPane.showOptionDialog
(null,"Relly Exit ?","Exit Confirmation ",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,null,null,null);
if(conf==0)System.exit(0);
class Deal implements ActionListener{
public void actionPerformed(ActionEvent e){
final JWindow myw=new JWindow();
myw.getContentPane().add(new Pan(), BorderLayout.CENTER);
JButton b3=new JButton("Bye !");
ActionListener mm=new ActionListener(){
public void actionPerformed(ActionEvent e){myw.dispose();}};
b3.addActionListener(mm);
myw.getContentPane().add(b3, BorderLayout.SOUTH);
myw.setSize(200,200);
myw.setLocation(500,300);
myw.setVisible(true);
class Pan extends JPanel{
public Pan(){
super();}
public void paintComponent(Graphics g){
super.paintComponents(g);
Graphics2D g2 = (Graphics2D) g;
g2.setPaint(Color.red);
g2.setStroke(new BasicStroke(4));
g2.drawOval(50, 30, 30, 30);
g2.drawOval(100, 30, 30, 30);
g.fillOval(60,45,10,10);
g.fillOval(110,45,10,10);
g2.setStroke(new BasicStroke(6));
g2.drawArc(40,60,100,50,-10,-160);
-
HI all pls give me diff btwn upload ws_upload and GUI Upload
HI All,
pls give me difference between
upload
ws_upload and
GUI Upload
Thanks & regards .
Bharat KumarHi,
WS_* Function modules are replaced by GUI_* FMs from 4.7 SAP version.
GUI_* modules have additional parameters when compared with WS_* FMs.
Both FM are used for uploading data .
But ws_upload is obsolete now .
WS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation.
WS_UPLOAD, GUI_UPLOAD FMs are used in BDCs.
WS_UPLOAD loads files from the Presentation Server to Internal ABAP Tables.
This is used upto SAP 4.6 version.
GUI_UPLOAD is used to loads a file from the PC to the server. The data can be
transferred in binary or text format. Numbers and data fields can be
interpreted according to the user settings.
You can check this for some info
http://help.sap.com/saphelp_erp2005/helpdata/en/79/c554a3b3dc11d5993800508b6b8b11/frameset.htm
http://www.sapdevelopment.co.uk/file/file_otherpc.htm
Regards,
Priyanka. -
How to calculate the number of vowels from a txt file. Pls give me a hand!!
Guys! How do i calculate the number of vowels from a txt file? I have to create a program to count the number of words, sentence, and vowels. So far I had managed to count the number of words. Now I need help on counting sentence and vowels! Pls give me a hand guys!
I first have to read from the file not the string.I
know how to read from a file. Now the problem ishow
to compare a character from a txt file!You fail to understand, that you have read the data
from the file into a string. Now loop over all
characters in the string. Forget about the file.
KajOr forget the scanners just as others have told you. Just read the file character by character using a FileReader.
Kaj -
I have hp g series its spyker not working properly pls give me any solution
i have hp pavilion g series. i was listening music first its left spesker turn off and after its both speaker turn off. i have cheaked all settings the all settings are correct pls give me any sollution.
I do not really know much about this kind of problem, but i may be your internet connection.
If you are on your own #G network then:
Go to Settings > then enable "Airplane Mode". Count to 10 and then disable it.
Then wait patiently until you get a good connection and then try again.
If you are on a nearby Wi-Fi connection then:
Go to Settings > Wi-Fi > then disable then enable after counting to 10. Make sure that you are connected and then try again.
If all else fails, then you need to contact your provider for assistance.
Sprint:888-211-4727
AT&T:?
Verizon:? -
Pls give me step by step sequence of Automatic Payment Prog
Hi,
Pls give me step by step sequence of Automatic Payment Program.
Thanks in AdvanceHi,
Automatic Processing : In this processing the system prepares open item to be paid and prepare a payment document & to this payment document the system prepares a cheque with the payment advise note automatically
Configuration of Automatic Payment Program : SPRO - Ref-IMG-FA-A/R&A/P u2013 Business Transaction- Outgoing Payments u2013 Automatic Outgoing Payment u2013 Payment Method/Bank Selection for payment program u2013 Set up all Company codes for payment transactions.(T.Code:FBZP)
New Entries
Company code : 6023
Control data
Paying Company code : 6023
Enter & Save back to menu item
Setup paying Company Code for Payment Transactions :
New entries
Paying Company Code : 6023
Control Data
Minimum amount for incoming payment ________
Minimum amount for outgoing payment 500 INR
Forms
Sender Details
Select Forms
Form for the payment advice u2013 Select International Payment advice Note F_110_IN_AVIS
Save back to menu Item
Setup payment methods per country per payment Transaction :
New Entries
Country IN
Payment method X (any identification No or Alpha)
Description Cheq
Payment method for
u2022 Outgoing payment
Payment method classification * Check
Posting Details
Document type for payment KZ
Clearing Document Type KA
Use classic payment medium programs payment medium program RFFOUS_C
RFFO : Program Code
US : Country
C : Payment
Name of Print dataset : LIST1S
& SAVE Back to menu Item
Setup payment methods per Co code for Payment Transactions
New Entries
Paying Company Code : 6023
Payment Method X
Minimum Amount 500
Maximum Amount 5000000
Select form data
Forms
Form for the payment transfer medium F_110_PRENUM_CHECK
(International u2013 Check (with check management)
Next form
Enter & Save back to menu item
Set up Bank determination for Payment Transaction :
Select Position button
Paying Company Code 6023
Paying Company Code Name
6023 Reliance Infocom
Select Company Code
Select Bank Selection : Ranking Order
New Entries
PAYMENT CURRENCY RANK ORDER HOUSE BANK
X INR 1 6SBI0
X INR 2 6ICIC (NEXT PREFERED BANK)
ENTER & SAVE
Select Bank Accounts
New Entries
HOUSE BANK PAYMENT CURRENCY ACCOUNT ID BANK SUB A/C
6SBI0 X INR 6S002 211002
6ICIC X INR 6I002 211002
If we do not specify currency --- all the currency accepted
Save
Select Available Amounts
New Entries
House Bank Account ID Days Currency Available for O/ Pay
6SBI0 6S002 999 INR 500000
6ICIC 6I002 999 INR 500000
Save & Bank to Menu Item
CHANGE VENDOR MASTER RECORD TO SPECIFY THE PAYMENT METHOD XK02 :
Vendor 1000000
Co Code 6023
Co Code Data
Payment Transactions
Enter
Automatic Payment Transactions
Payment Method X
& Save
lly
For all the Vendor Master Record specify the payment method
Execution of Automatic Payment Program :- Accounting u2013 FA u2013 A/P u2013 Periodic
Processing F-110 u2013 Payments
Enter Run Date : 20-04-2006
Identification Code : YRK00
Select Parameters
Posting Date : 20-04-2006 Doc entered upto 20-04-2006
Payment Control
Company Code Pmt Method Next Posting Date
6023 X 21-04-2006
Accounts
Select Vendor Accounts 1000000 to 3840099
Specify the range of vendors
Save the parameters
Select Status Button
Select Proposal Button
Start immediately
Continue
Press enter key until the system displays a message payment proposal has been created.
To Check Payments List u2013 Select Edit Proposal
Continue
The System displays
Vendor Item PM H.Bank Curr Amount
1000000 2 X 6S002 6SBIO INR 500000-00
To Block the Payment : Double click on the item - again double Click
Block
Payment Block A Blocked for payment
Continue
Select back button
Select exceptional list item u2013 Select Reallocation Block
Payment Method X
House Bank 6ICIC 61002
Continue
Select back button
Save
Select back button
Select Printout/datamedium
From printing/data medium exchange
Program Varient
RFFOAVIS 6023 AVIS
Keep the cursor on first row/Columns Enter
Name : 6023 AVIS
Select maintain Varients
Select Continue Button
Program run date
Paying Co. Code 6023
Number of Sample
u2022 Print immediately
u2022 Select attributes
Varient Name
Meaning Payment advice form
& Save
Select back button
Keep the cursor on 3rd row first column
Program Variant
RFFOAVIS 6023 AVIS
RFFOEDI1
RFFOUS_C 6023SBI (3RD ROW FIRST COLUMN)
Select maintain Variant
Paying Co Code : 6023
Further Selection
Paymethod X
House Bank 6SBI0
Account ID 6S002
Check Lot No : 2
* Print Checks Printer LP01 * Print immediately
* Print Payment Advise Note Printer LP01 * Print immediately
* Print Payment Summery Printer LP01 * Print immediately
Output Control
Number of Sample Printouts 0
Select Attributes Button
Varient Name 6023SBI
Meaning State Bank of India
Save
Select back button
From Printing
Program Variant
RFFOAVIS
RFFOEDI1
EFFOCUS_C 6023 ICICI
Maintain Varient
Paying Co Code : 6023
Further Selections
Payment Method X
House Bank 6 ICIC
Account ID 61002
Check Lot No.2
Print Control
* Print Checks Printer LP01 * Print immediately
* Print Payment Advise Note Printer LP01 * Print immediately
* Print Payment Summery Printer LP01 * Print immediately
Output Control
Number of Sample Printouts 0
Select Attributes Button
Varient Name 6023ICICI
Meaning ICICI
Save
Select back button
Select Status Button
Select Payment Run
Start Date : 20-04-2006 Start immediately
Create Payment medium
Select Continue Button
Press Enter Key until system the display message u2013 payment run has been carried out
Select Printout
Print JOB
JOB NAME F11020060420-YRK00--? 1
To check the job: System u2013 Services u2013 Output u2013Control u2013 Execute
Spool No Type Date Time Status Pg Title Cheque
*1167
Select Display Content Button
*1168 Payment Advice
Post with Print Form :
Accounting u2013 FA u2013 A/P u2013 Document Entry u2013 Outgoing Payment u2013 F-58
Post+Print Form
Payment method and form specifications
Co Code : 6023
Payment Method X
House Bank 6 ICIC
Check Lot No : 2
Alternative Form F110-PRENUM-CHK
Printer
Printer for Forms LP01 * Print immediately
Payment Advice Printer LP01
Enter Payments
Document Date : 20-04-2006
Posting Date : 20-04-2006
Bank Posting details
Amount : 10000
Value Date : 20-04-2006
Payee
Vendor 383001
Select Process Open Items
Select Partial Payment
Simulate
Post
Print Parameters
Output LP01
Number of copies 1
*Continue
The System display-PrintJob was generated System u2013 Services- Output Control
Spool Req Number XXXX
Execute Title
Cheque
u2022 Select Display Content Button -
Iam using Iphone4,my problem is while imake a call or when ia attend a incoming call,the screen doesnt lock,while i kept in my ear to attend a call it automatically gets inside keypad or it on hold tab this makes me uncomfortable pls give a solution
This sometimes happens if you have a case or screen protector on the phone. IF you have one of these remove it and see if it makes any difference
-
Pls give Link.... flash player problem
pls give me the link of the previous flash player that works..
im not a computer expert but its clear as day that something is wrong with the latest (10.1)...
pls...Hi, you can do that, but until the Uninstall is clean, you won't be able to Install the 10.0. It sounds as if you had an application in the system tray that was running when you ran the Uninstaller, since afterwards the 10.1 was still there.
Also, your operating system and browser(s) you use would be helpful.
Thanks
eidnolb -
Pls give me the code to load method only once in JVM.
Hi all,
Pls give me the code to execute method only once in JVM.Even if we create more than one instance to call the method.
Thanks & Regards,
Vinodh[How to ask a question on these forums|http://catb.org/~esr/faqs/smart-questions.html]
-
An unknown error occurred (0x80092013) what the **** is going on from last six month i am unable to access i tune store?pls give me solution which should help me to shortout this problem as soon as possible. i have not expected this from apple
I have been trying for months to put iTunes on my laptop and kept getting installation errors in Windows 7. I gave up and just installed iTunes on my PC running XP.
Now I have to install Quicktime on the laptop and once again I get an installation error 0x800736FD.
All windows updates are fine, none failed.
I have removed all apple software from my laptop using CCleaner, common files and folders. Tried reinstalling and still the same error.
Could you offer any advice on how to get both quicktime and then iTunes working??
Thank you in advance -
I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I can do to repair it
Please authorize ADE 3 with same credentials that you used with older version of ADE
-
Pls give the menu path for pricing schema for PO
Pls give the menu path for pricing schema for PO
Thanx
Vikas ChhabraHi,
we assign account assignment category in PO.Here is the path
IMG>Materials Management>Purchasing>Account Assignment>Maintain Account Assignment Categories OME9
Based on account assignment category you use in PO, it will ask you cost object in PO
E.g P (project) you need to enter G/L and WBS element
N Network G/L and Network
Like in SD account determination, OMWB is MM and FI integration.
Regards,
Chandra -
Pls. give some suggestion on Subsequent Credit and debit note?
Dear Gurus,
Pls. give some suggestion on Subsequent Credit and debit note?
Regrds
ShikhaHi Sikha
We generaly use subsequent debit / credit to adjust invoice value without affecting Qty
Pls check notes supplied by SAP
A subsequent debit/credit arises if a transaction has already been settled, and a further invoice or credit memo is received afterwards.
A subsequent debit/credit changes the total invoice value of a purchase order item; the total invoice quantity remains unchanged. Therefore, only a value-based update of the purchasing transaction takes place. There is no quantity-based update.
You must enter an invoice as a subsequent debit if a purchase order item has already been invoiced and further costs are incurred. (Example: A vendor has inadvertently invoiced you at too low a price and then sends a second invoice for the difference.)
You must enter a credit memo as a subsequent credit if a purchase order item was invoiced at too high a price and now you have received a credit memo. (Example: A vendor has inadvertently invoiced you at too high a price and then sends a credit memo for the difference.)
If you enter a subsequent debit/credit, the system suggests the entire invoiced quantity, but no value. The maximum quantity that you can subsequently debit or credit is the quantity that has already been invoiced.
You can only enter a subsequent debit/credit for a purchase order item if an invoice has already been posted for that item.
A subsequent debit/credit cannot refer to a particular invoice.
Subsequent debits and credits are listed separately in the PO history
Typical example is like
suppose vendor has overcharged u for perticular PO and afterward he want to correct it
In such scenario u can post subsequent debit to correct PO without affecting Qty. field
<b>Reward if usefull</b>
Vishal.. -
Hello ! pls give some ti[ps how to use bapi's for data uploading?
hello !
pls give some ti[ps how to use bapi's for data uploading?
regards,
ArjunHi,
See the below report extract:
where it_data is having uploaded data.
LOOP AT<b> it_data</b> INTO wa_data.
line_count = sy-tabix.
"Date Validation
CONCATENATE wa_data-uplft_date4(4) wa_data-uplft_date2(2) wa_data-uplft_date+0(2)
INTO wa_data-uplft_date.
"READ TABLE it_ekko INTO wa_ekko WITH KEY lifnr = wa_data-vendor.
LOOP AT it_ekko_temp INTO wa_ekko_temp WHERE lifnr = wa_data-vendor.
IF wa_ekko_temp-kdatb <= wa_data-uplft_date AND wa_ekko_temp-kdate >= wa_data-uplft_date.
MOVE-CORRESPONDING wa_ekko_temp TO wa_ekko.
APPEND wa_ekko TO it_ekko.
ENDIF.
ENDLOOP.
"IF sy-subrc = 0 AND wa_ekko-kdatb <= wa_data-uplft_date AND wa_ekko-kdate >= wa_data-uplft_date.
LOOP AT it_ekko INTO wa_ekko.
wa_data_header-pstng_date = wa_data-uplft_date.
wa_data_header-doc_date = sy-datum.
wa_data_header-bill_of_lading = wa_data-bill_of_lad.
wa_data_header-ref_doc_no = wa_data-del_no.
CONCATENATE wa_data-header_text1 '-'
wa_data-header_text2 '-'
wa_data-header_text3 '-'
wa_data-header_text4
into wa_data_header-HEADER_TXT.
IF wa_data-indicator = 'Y'.
wa_data_item-material = '000000000000200568'.
ELSE.
wa_data_item-material = '000000000000200566'.
ENDIF.
LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln = wa_ekko-ebeln AND matnr = wa_data_item-material.
"Collect Item Level Data
wa_data_item-plant = '1000'.
wa_data_item-stge_loc = '1001'.
wa_data_item-move_type = '101'.
wa_data_item-vendor = wa_data-vendor.
wa_data-qnty = wa_data-qnty / 1000.
wa_data_item-entry_qnt = wa_data-qnty.
wa_data_item-po_pr_qnt = wa_data-qnty.
wa_data_item-entry_uom = 'KL'.
wa_data_item-entry_uom_iso = 'KL'.
wa_data_item-orderpr_un = 'KL'.
wa_data_item-orderpr_un_iso = 'KL'.
wa_data_item-no_more_gr = 'X'.
wa_data_item-po_number = wa_ekpo-ebeln.
wa_data_item-po_item = wa_ekpo-ebelp.
wa_data_item-unload_pt = wa_data-unload_pt.
wa_data_item-mvt_ind = 'B'.
APPEND wa_data_item TO it_data_item.
CLEAR wa_data_item.
ENDLOOP.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_data_header
goodsmvt_code = goodsmvt_code
testrun = 'X'
TABLES
goodsmvt_item = it_data_item
return = return.
READ TABLE return INTO wa_return WITH KEY type = 'S'.
IF sy-subrc <> 0.
DESCRIBE TABLE return LINES sy-tfill.
IF sy-tfill = 0.
CALL FUNCTION <b>'BAPI_GOODSMVT_CREATE'</b>
EXPORTING
goodsmvt_header = wa_data_header
goodsmvt_code = goodsmvt_code
testrun = ' '
TABLES
goodsmvt_item = it_data_item
return = return.
CALL FUNCTION <b>'BAPI_TRANSACTION_COMMIT'</b>
EXPORTING
WAIT = 'X'
IMPORTING
RETURN =
ENDIF.
ENDIF.
LOOP AT return INTO wa_return.
WRITE: 'Messsage TYPE ', wa_return-type,
/,'ID ', wa_return-id,
/, 'Number ', wa_return-number,
/, 'Message ', wa_return-message,
/, 'Long Text ', wa_return-message_v1,
wa_return-message_v2,
wa_return-message_v3,
wa_return-message_v4,
/, 'Failed at line', line_count.
ENDLOOP.
CLEAR: wa_ekko, wa_ekpo, wa_data, it_data_item[], wa_data_header.
ENDLOOP.
Reward if useful! -
How to debugg the procedure..pls give example program
how to debugg the procedure..pls give example program
Hi,
There are various methods available to debug your procedure, like dbms_output, utl_file and some third party debugger like PL/SQL developer, TOAD,
SQL Navigator or SQL Developer.
Try any one of those.
Maybe you are looking for
-
Hi Apple / Logic Crew - Should you deceide to let X-Mass come early this year - here are a couple of wishes: 1) When hitting Record : Automatically deselect any selected regions.... (moving a region down one track then hitting record for a new take -
-
Hi Experts I am having a list of TAXCODES like. "CA" "CC" "CD" "DA" "DE" "WS" Now in purchase orders if i am having different line items having the above TAX CODES. i need to pass a variable &XXX& which is having text to sap script form. And if the
-
Cannot access iTunes tried all options on new iPad 2
I got new iPad configured everything but iTunes keep giving me "cannot connect toiTunes ". The Internet and wifi work fine. I logged in and out and powered on and off the device. Changed the DNA to 8.8.8.8, tried also airplane mode and back. Nothing
-
When or How does the time stamp on Report Manager / Data Collection change
Hi, I have been waiting since 10am waiting for data to be available. Unfortunately, the Sun MC has not updated the time stamp. I am unable to create graphs for the machines I setup this morning? Any ideas on how to post data faster than waiting forev
-
Custom Consumers vs. MDBs
What are some of the benefits to use J2EE�s message driven beans as suppose to writing your own threading and Message Consumers? Can someone really touch on the issues and problems one can expect when not using a J2EE container service for threading