I want to display a text when button pressed
Hi guys
I want to display a text when a button is pressed , but the compiler says cannot resolve variable text ,can you please help me
here is my program
import java.awt.Color .*; import java.awt .*; import java.awt.event.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JTable.*; public class sannaa extends JFrame implements ActionListener {[code] public sannaa( ) {
super("����� ������" ); setLayout(new FlowLayout()); TextField text = new TextField(20); JButton ok=new JButton( "return" ); add(text); ok.addActionListener(this);
Container contentPane = getContentPane( );
JLabel hellolabel=new JLabel("google"); hellolabel.setForeground(Color.black); hellolabel.setBackground(Color.blue); String[ ] columnNames =
{"First Name", "Last Name", "Sport",
"# of Years",
"Vegetarian"};
Object [ ][ ] data =
{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
{"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
{"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean (false)},
{"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
{"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)} };
JTable table = new JTable(data, columnNames); JButton enter=new JButton( "search" ); ok.setBackground(Color.pink); ok.setForeground(Color.white); JFrame frame=new JFrame("EL "); enter.setMaximumSize(new Dimension(900,
100)); enter.setForeground(Color.blue); contentPane.setBackground( Color.white); for(int i=0;i<10;i++) {[code]JButton rami=new JButton( ""+ "" +i );
contentPane.add(rami);
rami.setBackground(Color.blue); }
contentPane.add(ok);
JPanel panel=new JPanel(new BorderLayout(500,500) ); contentPane.setLayout(new FlowLayout( )); contentPane.add(panel); panel.add(enter, BorderLayout.PAGE_START); panel.add(table, BorderLayout.PAGE_START); panel.add(hellolabel, BorderLayout.PAGE_START); panel.setBackground( Color.white ); panel.setLayout(new BorderLayout()); panel.add(table.getTableHeader(),BorderLayout.PAGE_START ) panel.add(table, BorderLayout.CENTER); panel.add(hellolabel,BorderLayout.PAGE_END); setVisible(true); }
public void actionPerformed(ActionEvent e ) { [code] text.setText("Button Clicked ");
public static void main (String [] args) {[code] sannaa van=new sannaa( );
} }
Thanks
I have changed my program to the following and its compiled truely, but when I press thte button in the application no text appeared?
help me please
import java.awt.Color .*; import java.awt .*; import java.awt.event.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JTable.*; public class sannaa extends JFrame implements ActionListener {
public sannaa( ) {
super("����� ������" ); JButton ok=new JButton( "return" );
ok.addActionListener(this);
Container contentPane = getContentPane(
JLabel hellolabel=new JLabel("google");
hellolabel.setForeground(Color.black); hellolabel.setBackground(Color.blue);
String[ ] columnNames =
{"First Name", "Last Name", "Sport",
"# of Years",
"Vegetarian"};
Object [ ][ ] data =
{"Mary", "Campione", "Snowboarding", new Integer(5),
new Boolean(false)},
{"Alison", "Huml", "Rowing", new Integer(3), new
Boolean(true)},
{"Kathy", "Walrath", "Knitting", new Integer(2),
new Boolean (false)},
"Sharon", "Zakhour", "Speed reading", new
Integer(20), new Boolean(true)},
{"Philip", "Milne", "Pool", new Integer(10),
new Boolean(false)} };
JTable table = new JTable(data,
columnNames); JButton enter=new JButton( "search"
); ok.setBackground(Color.pink); ok.setForeground(Color.white); JFrame frame=new JFrame("EL "); enter.setMaximumSize(new Dimension(900,
100));
enter.setForeground(Color.blue); contentPane.setBackground( Color.white);
for(int i=0;i<10;i++) { [code]JButton rami=new JButton( ""+ "" +i );
contentPane.add(rami);
rami.setBackground(Color.blue); }
contentPane.add(ok);
JPanel panel=new JPanel(new
BorderLayout(500,500) ); contentPane.setLayout(new FlowLayout(
)); contentPane.add(panel); panel.add(enter, BorderLayout.PAGE_START);
panel.add(table,
BorderLayout.PAGE_START); panel.add(hellolabel,
BorderLayout.PAGE_START); panel.setBackground( Color.white ); panel.setLayout(new BorderLayout()); panel.add(table.getTableHeader(),BorderLayout.PAGE_START ) ;
panel.add(table, BorderLayout.CENTER);
panel.add(hellolabel,BorderLayout.PAGE_END);
setVisible(true); }
public void actionPerformed(ActionEvent e )
{ [code] TextField text=new TextField ("") ;
text.setText("Button Clicked "); }
public static void main (String [] args)
sannaa van=new sannaa( ); } }
Similar Messages
-
hi,
I'm using Apex4.2
How can I display drop list when button pressed ?
or is there any solution to create same interface as apex dev environment
ThanksProbably lot's of ways to do this but I would just give the drop down list a CSS class of hidden.
Put this in the CSS inline section of your page:
.hidden {
visibility:hidden;
and then on your drop down item in the field labeled HTML form element classes just add this: hidden
Then create a dynamic action on button click that uses JavaScript to remove this class:
$("#P10_YOUR_ITEM").removeClass("hidden");
See this example: http://apex.oracle.com/pls/apex/f?p=32581:2
username: guest
pw: app_1000
Click the Show Drop Down List button and the drop down item appears. -
Revision: 5831
Author: [email protected]
Date: 2009-03-31 16:50:47 -0700 (Tue, 31 Mar 2009)
Log Message:
Fix bug Fix SDK-19800 FxButton doesnt resize itself to display all text when lineBreak == toFit
Fix: implement text reflow support for TextGraphicelement.
QE Notes: None
Doc Notes:
Bugs: SDK-19800
Reviewer: Carol, Gordon
tests: checkintests, mustella
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-19800
http://bugs.adobe.com/jira/browse/SDK-19800
Modified Paths:
flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicE lement.as -
FRM-40735:WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06502
Hi,
I am trying to run a form in which I have a button which when pressed should display another popup window with few text fields in it. I have a WHEN-BUTTON-PRESSED trigger on that particular button and its raising an exception called
FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06502.
When I debug the form with breakpoints its displaying the popup window correctly, but if I run it in a browser as soon as click the button it raises the Unhandled exception given above.
Can anyone help with this? Urgent please....
ThanksIt is VERY good to handle your exceptions, specially a certain pre-defined exceptions like NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE etc...
You can also find samples on how to create user-defined exceptions, just search the online forms help (press the question mark in forms builder) for "User-Defined"
But however you handle your exception never ever do
WHEN OTHERS THEN NULL;If you do that you are telling to forms that no matter what kind of error is thrown do nothing, now that's very dangerous.
You might also want to check Oracle's documentation on [url http://www.oracle.com/pls/db102/portal.portal_db?selected=5]Application Development and do a search on "Exception Handling"
Regards,
Tony
Message was edited by:
Tony Garabedian -
FRM-40735:WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06503
Hello to all...
I am developing a form on form 6i like a registration form....
Suppose emp_name is a text item....
I need to validate that item such that number ,null and special characters should not be allowed.
I have created a function to check those validations
function v_check(p_item_name varchar2)
return boolean is
begin
for i in 1..length(p_item_name)
loop
if substr(p_item_name,i,'1') in ('1','2','3','$','%','@','!','#') then
return false;
end if;
end loop;
end v_check;
When i click on save_Record button it commit the form i'm checking the emp_name field with this validation by calling the above function.
for save_Record button i have written this code WHEN-BUTTON-PRESSED trigger
declare
a number;
begin
if :iptable.ip_name is null or (not v_check(:iptable.ip_name)) then
set_alert_property('alert',title,'name validation');
set_alert_property('alert',alert_message_text,'null ans spl char are not allowed');
a:=show_alert('alert');
go_item('iptable.ip_name');
raise form_trigger_failure;
end if;
if :system.form_status='CHANGED' then
set_alert_property('alert',title,'Save Box');
set_alert_property('alert',alert_message_text,'Do u want to save');
a:=show_alert('alert');
if a=alert_button1 then
commit_form;
else
raise form_trigger_failure;
end if;
else
set_alert_property('alert',title,'Save Box');
set_alert_property('alert',alert_message_text,'noting to Save Box');
raise form_trigger_failure;
end if;
end;
But i'm gettin this
FRM-40735:WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06503
exception
How can i resolve this error...help me
thanks...
Edited by: maddyd2k on Nov 25, 2010 10:37 AMHi,
Your function v_check actually can return a NULL value wich is not TRUE neither FALSE.
Modify your function like this :
function v_check(p_item_name varchar2)
return boolean is
l_return boolean := true;
begin
for i in 1..length(p_item_name)
loop
if substr(p_item_name,i,'1') in ('1','2','3','$','%','@','!','#') then
l_return := false;
end if;
end loop;
return l_return;
end v_check; -
FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-29261
FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-29261.
I m getting above message when I try to click on the button on form created using Form Builder 10G.
I want to send email using UTL_MAIL.
Code is:
declare
vSend VARCHAR2(30) := '[email protected]';
vSubj VARCHAR2(50) := '10g new mail package';
vMesg VARCHAR2(4000);
vMType VARCHAR2(30) := 'text/plain; charset=us-ascii';
BEGIN
vMesg:= 'Hello mail 10g worked';
utl_mail.send(vSend, '[email protected]', NULL, NULL, vSubj, vMesg, vMType, NULL);
END ;Pl tell me asap whether I am right or not?
-
Calling a report from forms - FRM-40735 when-button-pressed raised unhandle
Hi,
I created a form to generate a pdf report.
its not going too well, so i need some help.
my form only has one button , when pressed I want it to generate a report in pdf format.
i created a when-button-pressed trigger and the following code is below:
I also create a web service proxy jar file,
the jar file is in the FORMS_BUILDER_CLASSPATH, and the jar file is imported from forms builder without any issues.
As of now I am hard coding everything in the code below to see if it works.
The error I am getting FRM-40735 when-button-pressed raised unhandled exception ORA-105100 i dont know why ?
This error is occurring at this line of code, please help, this is my first time doing something like this.
obj := publicreportserviceclient.new(); DECLARE
param_name varchar2(200);
un varchar2(200);
pw varchar2(200);
out_file varchar2(200);
obj ORA_JAVA.JOBJECT;
BEGIN
obj := publicreportserviceclient.new();
param_name := 'EMP';
un := 'Administrator';
pw := 'Oracle123';
out_file := 'D:\DevSuiteHome_1\j2ee\home\default-web-app'||'output';
publicreportserviceclient.callRunReport(obj,'/~administrator/Learn/Test1/Test1.xdo','EMP','141414',un,
pw,'pdf','New_Template',out_file);
web.show_document('http://jmenge-de.de.oracle.com:8889/j2ee/' || 'output');
exception
--check for ORA-105101
when ORA_JAVA.EXCEPTION_THROWN then
message('Java Exception : '
|| Exception_.toString(ORA_JAVA.LAST_EXCEPTION));
ORA_JAVA.CLEAR_EXCEPTION;
return;
--check for ORA-105100
when ORA_JAVA.JAVA_ERROR then
message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
return;
END;This is my java function
public void callRunReport (String reportPath, String paramName, String paramValue, String
username, String password, String format, String template, String outFile) {
try {
bip_webservice.proxy.PublicReportServiceClient myPort = new bip_webservice.proxy.PublicReportServiceClient();
// Calling runReport
ReportRequest repRequest = new ReportRequest();
repRequest.setReportAbsolutePath(reportPath);
repRequest.setAttributeTemplate(template);
repRequest.setAttributeFormat(format);
repRequest.setAttributeLocale("en-US");
repRequest.setSizeOfDataChunkDownload(-1);
ParamNameValue[] paramNameValue = new ParamNameValue[1];
paramNameValue[0] = new ParamNameValue();
paramNameValue[0].setName(paramName);
String[] values = new String[1];
values[0] = paramValue;
paramNameValue[0].setValues(values);
repRequest.setParameterNameValues(paramNameValue);
ReportResponse repResponse = new ReportResponse();
repResponse = myPort.runReport(repRequest,username,password);
byte[] baReport = repResponse.getReportBytes();
FileOutputStream fio = new FileOutputStream(outFile);
fio.write(baReport);
fio.close();
} catch (Exception ex) {
ex.printStackTrace();
}Thanks - please helpIf there is a way to make it work with Bi publisher, Please let me know.
I need to something to make it work with BI publisher.
thanks,
Edited by: Rooney on May 27, 2010 1:27 PM -
How can I call my chart in Forms6i on When Button Press Trigger?
Hi Friends,
I have make a chart in Graphic Builder 6i and save on path C:\graph\test.ogd
Now I want to run this Chart from Form6i on When Button Press trigger.
I have call my report in forms using this command on When Button Press trigger.
Run_Product(reports,'C:\Cheema\Qdir_store\reports\pmms\sec_backlog',asynchronous,runtime,filesystem,TO_CHAR(NULL));
So tell me How can I call my chart in Forms6i?
Please reply me on urgent.
Thanks,
ShahzadJust to recall after a long break of couple of years..... Pls check out if not wrong.
First of all you need to embeed the chart object on your layout window and make it visible = FALSE. This is a design time work. In the button press event, show the chart object by setting the visible property = TRUE.
Note, i could not paste u the sample code as i don't have forms installation on my PC. The above states is a logic you can apply. -
Calling a function in WHEN-BUTTON-PRESSED
Hello,
i have in when-button-pressed a line containing
select pachet_salarizare.ani_vechime(data_min, to_number(to_char(sysdate,'YYYY')), to_number(to_char(sysdate,'MM'))) into ani_vechime from dual;so i call a function which is in pachet_salarizare package (package created in program units, in Forms).
when compiling, i get: function 'PACHET_SALARIZARE.ANI_VECHIME' mai not be user in SQL.
how can i deal with this? i need the result of that function in a variabie, ani_vechime.
Thanks!Uh, thank you. i thought it's not possible what i wanted..
but strange why cannot be called function in select statements
Regards, -
Requerying in WHEN-BUTTON-PRESSED
Hi,
I have two forms. I have a button that opens up modal form 2 from form 1 and passes some parameters. I allow the user to update something in form 2 (which has an effect on form 1). When user exits form 2, I want to requery the block in form 1 so that any updates effected in form 2 can be visible.
I tried putting in a do_key('execute_query') in the WHEN-BUTTON-PRESSED trigger in form 1 after the call to open form 2. This had no effect (probably because it didn't get called when I expected it to). The only way I am able to get the new data (after an update in form 2) is to manually issue a requery in form 1.
Any suggestions would be deeply appreciated!
Thanks,
NiranjanHi Niranjan
Put the Execute_query in the when-new-form-instance of the Called form.
With Regards
Harish
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Niranjan Ramakrishnan:
Hi,
I have two forms. I have a button that opens up modal form 2 from form 1 and passes some parameters. I allow the user to update something in form 2 (which has an effect on form 1). When user exits form 2, I want to requery the block in form 1 so that any updates effected in form 2 can be visible.
I tried putting in a do_key('execute_query') in the WHEN-BUTTON-PRESSED trigger in form 1 after the call to open form 2. This had no effect (probably because it didn't get called when I expected it to). The only way I am able to get the new data (after an update in form 2) is to manually issue a requery in form 1.
Any suggestions would be deeply appreciated!
Thanks,
Niranjan<HR></BLOCKQUOTE>
null -
When-button-pressed---adding a "select statement"
Hi friends,
i have a select statement:
select count(*) from employees
where emp_no=:control.emp_no;
i would like that when i press a button, count for instance, i get the number of employees.
I need the codes used in oracle in the when-button-pressed.
Thanks.DECLARE
RESULT NUMBER :=0;
CURSOR CUR
select count(*) from employees
where emp_no=:control.emp_no;
BEGIN
OPEN CUR;
FETCH CUR INTO RESULT;
:ITEM_NAME := RESULT;
CLOSE CUR
END;
I hope this will help
This will be shown in item, if you want to show a message then use
MESSAGE(RESULT);
Regards
Abbas
Edited by: Abbas on Jul 19, 2011 12:37 PM -
FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-106561
I m working on Fusion Middleware forms 11g with windows plateform. I want to launch an exe (like notepad.exe) from my form on button click, which i m doing using the webutil dde.app_begin. My form is deployed on server, and i want to launch this application from client. The server is on linux. Now when i press the button it gives me error "FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-106561". Here is my code:
DECLARE
AppID PLS_INTEGER;
BEGIN
AppID := DDE.App_Begin('notepad.exe',DDE.App_Mode_Normal);
END;
Any help will be highly appreciable. Also, please tell me for any possibility, if i can call this exe from server, which is on linux.
Regards,
SharjeelAny one there pls help me in this. I seen all the forums and threads, for this, but could'nt find any solutions.
Any help will be highly appreciable.
Regards,
Sharjeel -
FRM-40735:when-button-pressed trigger raised unhandled exception ORA-24247
hi all
i am using form 10g release2 i am having a problem
when i use the following stored procedure in form then i am getting this
error.
FRM-40735:when-button-pressed trigger raised unhandled exception ORA-24247
but the same code working fine when i use in SQLPLUS.
CREATE OR REPLACE PROCEDURE mail_attach (dir1 VARCHAR2, filename VARCHAR2)
AS
l_output utl_file.file_type;
l_file RAW(32767);
l_size NUMBER;
BLOCK NUMBER;
b BOOLEAN;
l_start NUMBER := 1;
TYPE ARRAY IS TABLE OF VARCHAR2(255);
l_data ARRAY := ARRAY([email protected]');
BEGIN
UTL_FILE.FGETATTR(dir1, filename, b, l_size, BLOCK);
l_output := utl_file.fopen('BACKUP', 'code.txt', 'r' );
utl_file.get_raw(l_output, l_file, l_size);
utl_file.fclose( l_output );
FOR i IN l_start .. l_data.COUNT
LOOP
UTL_MAIL.SEND_ATTACH_RAW (
sender => 'Mailer',
recipients => l_data(i),
subject => 'Data for ' || TO_CHAR((SYSDATE-1),'DD-MON-YYYY'),
attachment => l_file,
message => 'Dear User, Please find attached the upload
data for the period mentioned in the subject line.',
att_inline => FALSE,
att_filename => filename);
l_start := l_start + 1;
END LOOP;
END;and this is used in form when-button-pressed trigger.
BEGIN
mail_attach('UTL_PATH','code.txt');
message('FIle send successfully');
message('File send successfully');
END;hi
Mehwish now check the following code and its working fine with me in form..........
declare
dir1 VARCHAR2(200);
--filename VARCHAR2(200):='Logon.jpg';
filename VARCHAR2(200);
l_output utl_file.file_type;
l_file RAW(32767);
l_size NUMBER;
BLOCK NUMBER;
b BOOLEAN;
l_start NUMBER := 1;
TYPE ARRAY IS TABLE OF VARCHAR2(255);
l_data ARRAY := ARRAY('[email protected]');
BEGIN
-- EXECUTE IMMEDIATE 'ALTER SESSION SET smtp_out_server = ''192.168.56.103:25''';-- this is IP address and port of the server
UTL_FILE.FGETATTR(dir1, :filename, b, l_size, BLOCK);
--select directory_path into :filepath from dba_directories where directory_name='BACKUP';
l_output := utl_file.fopen('BACKUP',:filename, 'r' );-- i added :filename as a text item.
utl_file.get_raw(l_output, l_file, l_size);
utl_file.fclose( l_output );
FOR i IN l_start .. l_data.COUNT
LOOP
UTL_MAIL.SEND_ATTACH_RAW (
sender => 'Mailer',
recipients => l_data(i),
subject => 'Data for ' || TO_CHAR((SYSDATE-1),'DD-MON-YYYY'),
attachment => l_file,
message => :f,-- this is message item.
att_inline => FALSE,
att_filename => :filename);--this is attachment file name.
l_start := l_start + 1;
END LOOP;
message('File Send Successfully');
message('File Send Successfully ');
END;hope this helps you.
Attachment and mail are working fine with me, i can send attachment..............
sarah -
When button pressed: Multiple buttons
Regarding the 'When Button pressed' condition available in various places (computations, branches, processes, etc), it offers me the option to select exactly one button.
How can I make it so that I want the thing to fire when either Button 1 or 2 or 3 is pressed?
ThanksMartin - Whenever a page is submitted with a button, the request value is set to a property from the button, either the button name for standard buttons or the request value attribute for item buttons. In either a PL/SQL expression condition or in some of the declarative condition types that look at the request value, you can compare it to a list of values that you're interested in.
Note that the request value doesn't necessarily tell you which button was pressed. It tells you that some event set the request value. If your page can be submitted with a tab or with javascript that you put somewhere on the page, or if you've given multiple buttons the same request value, it's up to you to prevent ambiguity about the button-to-request mapping.
Scott -
Frm-40735-when-button-pressed trigger raises unhandled exception ora-01430
Hi,
I am running my developer6i application on winxp on one of my clinet side I got error frm-40735-when-button-pressed trigger raises unhandled exception ora-01430 when I press the button which give me the alter button to select yes or no before this the error araises.. but in the other client side its working correctlly with no such error message on same OS and developer6i version...i suppose you are getting 1403 and not 1430
++++++
Error: ORA 1430
Text: column being added already exists in table
Cause: An ALTER TABLE ADD statement specified the name of a column that is
already in the table.
All column names must be unique within a table.
Action: Specify a unique name for the new column, then re-execute the
statement.
++++++
1403 is no data found
so most likely you are executing a
select ... into ...
which is user dependent through where clause
that might be an explanation to your problem
but more info is needed on that
and surely you must clarify the ORA error you are getting.
Maybe you are looking for
-
Problem in displaying map.
Hi I am not able to display the map in my device. I have downloaded the google map in my device and i am getting the error , if i start the application. The error is : "This application requires a data connection and some blackberry require reconfigu
-
Hello! I have a JFrame that contains some components I would rather didn't shrink below a minimum size, which I have specified using setMinimumSize. Everything works fine if I have te following line in my code: JFrame.setDefaultLookAndFeelDec
-
Hi, We were compileing and linking the _beginthread (include <process.h>) function successfully in compiler 4.2. Now I get: Undefined symbol _beginthread I thought I was using all the proper C runtime libraries: -lCstd -lCrun -liostream Am I missing
-
I want creating an invoice to receive "sales revenue received in advance" before issue goods to customer. How can i do it ?
-
Calling a report from another program
Hi friends, I want to run an existing report from one function module and I need the output in an internal table for further processing.But I don't want to change the called program for any export to memory.How can we do it ? Thanks in advance, Joby