Giving spaces dynamically
Hi,
The requirement is i have a field in internal table of length say 35. i have to concatenate the data in this field along with other data into a variable of length 100.
eg -
field a(35) type c.
variable txt(100).
if the field A contains 10 character value then remaining 25 i have to give spaces while concatenating.
if it contains 20 charachter value, then remaining 15 should be give spaces while concatenating.
so, there can be any combination of values and spaces. I have to handle it dynamically.
Best Regards,
Hi Mohammadi siddiqui,
You can use this :
REPORT ztest1.
DATA :
lv_text1(10) VALUE 'abc',
lv_text2(20).
START-OF-SELECTION.
WRITE lv_text1 TO lv_text2 RIGHT-JUSTIFIED. <-- right-justified fills the left part with spaces automatically
Also you can calculate length difference and use SHIFT command like this code :
REPORT ztest1.
DATA :
lv_text1(10) VALUE 'abc',
lv_text2(20).
DATA :
lv_len1 TYPE i,
lv_len2 TYPE i,
lv_diff TYPE i.
START-OF-SELECTION.
" 1 move text
lv_text2 = lv_text1.
" 2 Find difference of length :
lv_len1 = STRLEN( lv_text1 ).
DESCRIBE FIELD lv_text2 LENGTH lv_len2 IN CHARACTER MODE.
lv_diff = lv_len2 - lv_len1.
" 3 Shift value abc in text lv_text2
SHIFT lv_text2 RIGHT BY lv_diff PLACES.
Edited by: Bulent Balci on Aug 6, 2010 11:15 AM
Similar Messages
-
Smartform utilisation of the footer window space dynamically
Hi All
I have created a smart form with a main window and footer window below the main window, in all pages where the table data is printing over the main window ,the space is left for the footer window since the footer window data will be printed only after completion of main window only. Now in all the pages space is left below the page... How to utilize the space dynamically for footer window only after completion of main window.
If main window data is there then footer window space should be utilized by main window in all pages. and if main window data is completed then only the footer window space should be considered and printing the footer text.
How to achieve this....... please guide me
Regards,
Lokesh.Hi Lokesh,
just place your this template after all of your data in main window (as shown after the table in screenshot below), i.e. after your table and make its usual flow , as shown in below screenshot, whenever your all data get printed then the text in these smartform will get printed.
i.e, put your this template as last element in your smartform, and let it be printed as usual
If you are not able to do it like as shown above, then go to the template and Double Click it, then Go to its Conditions Tab, and Check the "only before end of Main window."
Let me revert , if still your problem persist. -
Webcenter Spaces: Dynamic list of items to display in a page
I have a dynamic query created with backing bean in Webcenter portal, it has a input field and command button. My query returns items dynamically. Now, I want the similar functionality in Spaces. I tried uploading the content presenter template with the input field and command button and backing bean. But Its not working same way it does in portal. Please let me know.
I created:
* Created a backing bean which createds a dynamic query based in input text field.
* Created a jspx file and added content presenter and modified parameters with bean information.
* When portal application runs, the content is displayed.
Then, I created Content presenter template with input text field and command button and created .ear file from resource catalog.
Uploaded to Spaces.
I created a page in space, and tried add content, then the wizard forces to select the content type aswell.
Please help with the above.
ThanksI figured it out. var context = web.Context;
var list = web.Lists.GetByTitle(listTitle);
var view = list.Views.GetByTitle(viewTitle);
view.RowLimit = rowLimit;
view.Update();
context.ExecuteQuery(); -
Version.bundle giving space errors
I'm having trouble with the Version device that was set up with FCS. Although there are 350 gigs of space available, I keep getting out of space errors. When I check a project in, it tries multiple times to copy it to the Version device, giving "error: E_FD, file write error, No space left on device" each time in the Log, and then giving an error of "Error: E_COM Error in comms channel to LDS (LDS did not complete request)" when the job fails.
If I turn off versioning, I can check in projects no problem.
I've checked permissions and added an edit in place URI to the device, as it is on XSAN. I can open up the bundle, and the subfolders allow anyone to write, but will only make files of size 0, as it thinks it is out of space. Any ideas?Is the version.bundle located on the Xsan?
If so is that folder being stored on an Xsan affinity that has run out of space?
Nicholas Stokes
XPlatform Consulting -
Receiver SFTP adapter giving spaces between characters in the Output file
Hi PI Experts,
My Scenario is: Paymul (EDI file ) ECC -> PI -> SFTP server.
Source Sender File adapter able to pickup this Paymul D96A file and able to send messages to target SFTP server using SFTP receiver adapter.
But, Generated Output file having single space between each character. I am not using any content conversion modules in Receiver SFTP adapter.
Also not having any mappings to transform the messages. it is just pass through interface.
I have attached example Output file. I have changed the .Dat file to .txt just to attach here.
Could any one try to help me on this. Please let me know incase need any more details.
Thanks,
Govindu.Hi Govindu,
Please see if the below Endcoding settings wont resolve your issue.
File Type - Text
File Encoding - ISO-8859-1
Regards,
Jannus Botha -
Turkish Character 'u0130' giving space during PDF conversion of the smartforms
Hi,
I have a PO form in turkish language , which is converted into pdf file.
When we take the print of the PO form the all the turkish are displayed correctly.
But when the same form is converted into pdf , then only for the turkish character 'İ' there is a space after each time it is displayed in pdf. All other turkish caracters are being displayed correctly.
For example : for " TEDARİKÇİADRESİ" in pdf it comes as "TEDARİ KÇİ ADRESİ ".
Note : the device driver is installed correctly as per the OSS notes and all other turkish character is coming correctly as expected.Hi Adrian,
Yes the basis team did installed the window type fonts as mentioned in the OSS notes.
All the other turkish characted are being displayed correctly apart from this chracter. that too only in PDF.
Regards,
Syed -
How to display applications in tabs on a single page in webcenter spaces
Hi,
I am working on a project in Webcenter spaces where we have a welcome page with few hyperlinks on a bar in the top section .Each hyperlink is associated with an application url. The requirement is when a user clicks on any link, it should populate a tab in the page displaying the application.
For ex, if we have the links on the top as "google", "yahoo", "bing", etc, clicking on each one of them, should open tabs below displaying the respective home page. It should not open the application in a new browser but a tab in the same page. Also, the tabs are just page fragments (.jsff). As user clicks more links, more tabs are opened ( if that application is already not open).
In short, we are replacing opening of a new browser to opening a tab in the same browser ( when clicking an application link).
The issue is - how do I get the content of a website (or an application) into a tab in webcenter spaces dynamically. We tried using Pagelet producer but they need to be predefined. Also, each application url need to contain the session cookie, so user need not login to the application again.
Any alternate strategy to acheive the same result is also welcome.Not 100%. Although, I did find out that I can use an Inline Frame layout component which can take a url as one of its property. Thus, I can dynamically pass this property and make the layout render the application. Beyond this, the control will be transferred to application and I hope it will work. We are still in the process of playing with the components.
-
No space in the volume db not starting
Version : 10.2.0.3
Os : Linux rhl 4
Problem : the volume /u02 is 100% full and db is down. The volume consists of dbf, log, ctl files other than that no other files in the volume to create space.
To rename the data files to another volume I need to put the database in the mount stage. I am not able to start database in the mount stage as it is giving space problem
What should be the action
Steps want to follow copy the datafile to other volume
1. startup mount
2. alter database renmae datafile '/u02/oradata/hcl/hcl01.dbf' to '/u07/oradata/hcl/hcl01.dbf'
3. alter database open
4. remove the datafile in volume /u021. copied the the files at os level using cp
2. I am not able to put db in mount stage as it
saying nospace in the volume /u02
3. I can go to rename stage when I can put the db in
mount stageInstead of copy , you should move file to other mount point, so you will have some space /u02. Once you mont database and rename datafile, make sure all datafile in /u02 have AUTO EXTENT OFF.
# Virag -
Hi,
I am using coldfusionmx6 and created function.while it calling in xml it giving space.How to delete space?
<cffunction name="datereplaceformat" returntype="string">
<cfargument default="" name="datechange" required="No">
<cfargument default="" name="formatchange" required="No">
<CFSET var SDATE=reREPLACE(datechange,"#formatchange#"," ","all")>
<CFSET var rspace=reREPLACE(SDATE," ","","all")>
<cfreturn rspace>
</cffunction>
sample xml:
<cfoutput>
<va4>
<datepost>#trim(datereplaceformat(variables.NotPostedTransDate,"/"))#</datepost>
</va4>
</cfoutput>
In posting page it showing as
<va4>
<datepost>
10302010
</datepost>
</va4>
Advance ThanksAdding the output="no" property to the the <cffunction...> tag so that ColdFusion does not include any whitespace from the function may help.
You may also want to consider some of ColdFusion's other whitespace management features. <cfsilent>...</cfsilent> <cfsetting enableCFoutputOnly="Yes"> being a couple of the most utilized. -
Why extra space added in generated HTML?
We've noticed that WebLogic adds a significant amount of space in generated
HTML (like 3.5K). We're curious if there is a way to prevent this or limit
the amount of this space since this adds extra unnecessary wait time for
dialup users. Does anyone have experience with this?
My reply was entirely garbled ... I am trying again
Some HTML<br>
<% jsp code ...<br>
%>
Instead use...
Some HTML<% <BR>
jsp code ...<br>
%>
"Shubhrajit Chatterjee" <[email protected]> wrote:
>
>Hi,
>In case the problem has not been solved yet...
>
>If you begin a scriptlet tag(or any server side tag) on a new line like
>this...
>
>Some HTML
><% jsp code ...
>%>
>
>then when the servlet is generated, one empty out.println() is coded
>due to the
>empty place between the scrptlet tag, and thus generating an empty line
>
>You can prevent this by starting every scriptlet ( or any other serverside
>tag
>in the same line as HTML as given below
>
>Some HTML<%
>Some JSP
>%>
>
>However, only two characters (CR and LF are added if the scriptlet starts
>on the
>first column, so this won't make the page much slower. Avoid giving spaces
>before
>starting scriptlets, however...
>
>Shubhrajit
>
>
>
>"Dmitry Namiot" <[email protected]> wrote:
>>
>>Check out Optimize taglib from Coldtags suite:
>>http://www.servletsuite.com/jsp.htm
>>
>>"chip" <[email protected]> wrote:
>>>We've noticed that WebLogic adds a significant amount of space in generated
>>>HTML (like 3.5K). We're curious if there is a way to prevent this
>or
>>>limit
>>>the amount of this space since this adds extra unnecessary wait time
>>>for
>>>dialup users. Does anyone have experience with this?
>>>
>>>
>>
>
-
email send program code as follows but note that we dont have e-mail server .
is it possible without email server or not?
REPORT zattach_email MESSAGE-ID zz
LINE-SIZE 132
NO STANDARD PAGE HEADING.
DATA: t_mailhex TYPE STANDARD TABLE OF solix,
t_contents TYPE STANDARD TABLE OF solisti1,
wa_contents TYPE solisti1,
w_file TYPE dsvasdocid,
w_extn(5) TYPE c,
w_mail_subj TYPE string,
w_document TYPE REF TO cl_document_bcs.
CONSTANTS:
*-- Constants used in the body of the Email (HTML)
c_htm TYPE char3 VALUE 'HTM',
c_style_start TYPE char255 VALUE '<FONT face=Arial size=2>',
c_new_line TYPE char255 VALUE '<br>',
c_link_start TYPE char128 VALUE '<A href="www.w3schools.com">',
c_link_text TYPE char32 VALUE 'Link for learning HTML',
c_link_end TYPE char4 VALUE '</A>',
c_space(6) TYPE c VALUE ' ',
*-- Used as an Example for displaying space between texts in Email body
c_emp1(6) TYPE c VALUE 101001,
c_emp2(6) TYPE c VALUE 101002,
c_emp3(6) TYPE c VALUE 101003.
*-- Input Details - Block
SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-t01.
PARAMETERS: p_attach TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK file.
*-- Email ID of the Recipient
SELECTION-SCREEN BEGIN OF BLOCK mail WITH FRAME TITLE text-t02.
SELECT-OPTIONS: s_mailid FOR somlreci1-receiver NO INTERVALS.
SELECTION-SCREEN END OF BLOCK mail.
*-- Providing F4 Help for the input file
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_attach.
PERFORM file_path USING 'P_ATTACH'.
START-OF-SELECTION.
IF p_attach IS INITIAL.
MESSAGE i999(zz) WITH 'Please Enter at-least one file name'(001).
EXIT.
ENDIF.
*-- Upload data from Presentation Server to SAP
PERFORM upload_data.
END-OF-SELECTION.
*-- Frame the Body of the Email
PERFORM frame_mail_body.
*-- Send Mail
PERFORM send_mail.
FORM file_path USING fp_file TYPE any.
*-- Selects the directory list
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = fp_file
dyname = sy-cprog
dynumb = sy-dynnr
filetype = 'P'
location = 'P'
server = space.
ENDFORM. " file_path
FORM upload_data.
*-- Local data declaration
DATA: l_file TYPE string,
l_index TYPE sy-tabix,
*-- For holding the split file name
tl_splitfile TYPE STANDARD TABLE OF rlgrap-filename,
wl_splitfile TYPE rlgrap-filename.
l_file = p_attach.
**-- Function module to split the Filename and Extension from the Path
CALL FUNCTION 'CH_SPLIT_FILENAME'
EXPORTING
complete_filename = l_file
IMPORTING
extension = w_extn
name = w_file.
*-- Split the filename at '.'
SPLIT l_file AT '.' INTO TABLE tl_splitfile.
DESCRIBE TABLE tl_splitfile LINES l_index.
*-- In case the filename contains more than one dot
IF l_index GT 2.
CLEAR: wl_splitfile, w_extn.
*-- Get the Extension of the file
READ TABLE tl_splitfile INTO wl_splitfile INDEX l_index.
w_extn = wl_splitfile.
DELETE tl_splitfile INDEX l_index.
DELETE tl_splitfile INDEX 1.
CLEAR wl_splitfile.
*-- Get the Actual filename
LOOP AT tl_splitfile INTO wl_splitfile.
CONCATENATE '.' wl_splitfile INTO wl_splitfile.
ENDLOOP.
CONCATENATE w_file wl_splitfile INTO w_file.
ENDIF.
CONDENSE w_extn.
*-- Upload File
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'BIN'
TABLES
data_tab = t_mailhex
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc IS NOT INITIAL.
MESSAGE i999(zz) WITH 'Error in reading file for upload'(002)
w_file.
ENDIF.
ENDFORM. " upload_data
FORM frame_mail_body.
*-- Local data declaration to hold the textpool
DATA: tl_textpool TYPE STANDARD TABLE OF textpool,
wl_textpool TYPE textpool.
*-- Read the Entire Textpool into an Internal table
READ TEXTPOOL sy-repid INTO tl_textpool LANGUAGE sy-langu.
IF sy-subrc IS INITIAL.
SORT tl_textpool BY id key.
ENDIF.
*-- Font start
CLEAR wa_contents.
wa_contents-line = c_style_start.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- Program name : Email Attachment
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T03'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
*-- "#" Present in the Text Element will be replaced by the below value
REPLACE: '#' WITH 'Email Attachment' INTO wa_contents-line.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- You can also change or add the text here...
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T04'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- For giving spaces between texts, you can use...
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T05'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- For Ex; Employee Numbers :
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T06'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
*-- How to give Spaces in between texts
CONCATENATE wa_contents-line c_space c_emp1 c_space c_emp2
c_space c_emp3 INTO wa_contents-line.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- For more Information on HTML..
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T07'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- Hyperlink
CLEAR wa_contents.
CONCATENATE c_link_start c_link_text c_link_end INTO wa_contents-line.
APPEND wa_contents TO t_contents.
*-- Subject of the Mail
CONCATENATE text-t08 w_mail_subj INTO w_mail_subj.
ENDFORM. " frame_mail_body
FORM send_mail.
*-- Local data declaration for sending mail
DATA: l_send_request TYPE REF TO cl_bcs,
l_document TYPE REF TO cl_document_bcs,
l_sender TYPE REF TO cl_sapuser_bcs,
l_sub TYPE char50,
l_recipient TYPE REF TO if_recipient_bcs,
tl_contents TYPE STANDARD TABLE OF soli,
l_doc_len TYPE so_obj_len,
l_cnt TYPE sy-tabix,
l_rcv_email TYPE adr6-smtp_addr,
l_result TYPE sy-binpt,
l_bcs_exception TYPE REF TO cx_bcs,
l_subj TYPE string,
wl_mailid LIKE LINE OF s_mailid.
TRY.
*-- Create persistent send request
l_send_request = cl_bcs=>create_persistent( ).
tl_contents[] = t_contents[].
*-- Get the length of the Document
DESCRIBE TABLE tl_contents LINES l_cnt.
READ TABLE tl_contents INTO wa_contents INDEX l_cnt.
l_doc_len = ( l_cnt - 1 ) * 255 + STRLEN( wa_contents ).
*-- Subject of the mail
l_sub = w_mail_subj.
*-- Create Document
l_document = cl_document_bcs=>create_document(
i_type = c_htm
i_text = tl_contents
i_length = l_doc_len
i_subject = l_sub
i_language = sy-langu
i_importance = '1' ).
*-- Subject of the mail
MOVE w_mail_subj TO l_subj.
w_document = l_document.
TRY.
*-- Set the Message Subject
CALL METHOD l_send_request->set_message_subject
EXPORTING
ip_subject = l_subj.
CATCH cx_sy_dyn_call_illegal_method.
ENDTRY.
*-- Add document to send request
CALL METHOD l_send_request->set_document( l_document ).
*-- Do send delivery info for successful mails
CALL METHOD l_send_request->set_status_attributes
EXPORTING
i_requested_status = 'E'
i_status_mail = 'A'.
*-- Set sender
l_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD l_send_request->set_sender
EXPORTING
i_sender = l_sender.
*-- To frame the attachments for the mail
PERFORM frame_attachments.
*-- Add the recipients to the Send mail
LOOP AT s_mailid INTO wl_mailid.
l_rcv_email = wl_mailid-low.
CHECK NOT l_rcv_email IS INITIAL.
l_recipient = cl_cam_address_bcs=>create_internet_address(
l_rcv_email ).
CALL METHOD l_send_request->add_recipient
EXPORTING
i_recipient = l_recipient
i_express = 'X'.
ENDLOOP.
*-- Send Email
CALL METHOD l_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = l_result ).
IF l_result = 'X'.
MESSAGE s999(zz) WITH
'Approval Mail Sent Successfully'(003).
ENDIF.
CATCH cx_bcs INTO l_bcs_exception.
IF l_result NE 'X'.
MESSAGE s999(zz) WITH
'Approval Mail Not Successful'(004).
ENDIF.
ENDTRY.
COMMIT WORK. "Commit Work
ENDFORM. " send_mail
FORM frame_attachments.
*-- Local Data declaration
DATA: l_subject TYPE so_obj_des,
l_att_type TYPE soodk-objtp.
*-- Subject of the Attachment
l_subject = w_file.
*-- Format of the Attachment
l_att_type = w_extn.
IF t_mailhex[] IS NOT INITIAL.
TRY.
*-- Add Attachment to the Document
CALL METHOD w_document->add_attachment
EXPORTING
i_attachment_type = l_att_type
i_attachment_subject = l_subject
i_att_content_hex = t_mailhex.
CATCH cx_document_bcs.
ENDTRY.
ENDIF.
ENDFORM. " frame_attachments
Thanks,
Jyotsnaemail send program code as follows but note that we dont have e-mail server .
is it possible without email server or not?
REPORT zattach_email MESSAGE-ID zz
LINE-SIZE 132
NO STANDARD PAGE HEADING.
DATA: t_mailhex TYPE STANDARD TABLE OF solix,
t_contents TYPE STANDARD TABLE OF solisti1,
wa_contents TYPE solisti1,
w_file TYPE dsvasdocid,
w_extn(5) TYPE c,
w_mail_subj TYPE string,
w_document TYPE REF TO cl_document_bcs.
CONSTANTS:
*-- Constants used in the body of the Email (HTML)
c_htm TYPE char3 VALUE 'HTM',
c_style_start TYPE char255 VALUE '<FONT face=Arial size=2>',
c_new_line TYPE char255 VALUE '<br>',
c_link_start TYPE char128 VALUE '<A href="www.w3schools.com">',
c_link_text TYPE char32 VALUE 'Link for learning HTML',
c_link_end TYPE char4 VALUE '</A>',
c_space(6) TYPE c VALUE ' ',
*-- Used as an Example for displaying space between texts in Email body
c_emp1(6) TYPE c VALUE 101001,
c_emp2(6) TYPE c VALUE 101002,
c_emp3(6) TYPE c VALUE 101003.
*-- Input Details - Block
SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-t01.
PARAMETERS: p_attach TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK file.
*-- Email ID of the Recipient
SELECTION-SCREEN BEGIN OF BLOCK mail WITH FRAME TITLE text-t02.
SELECT-OPTIONS: s_mailid FOR somlreci1-receiver NO INTERVALS.
SELECTION-SCREEN END OF BLOCK mail.
*-- Providing F4 Help for the input file
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_attach.
PERFORM file_path USING 'P_ATTACH'.
START-OF-SELECTION.
IF p_attach IS INITIAL.
MESSAGE i999(zz) WITH 'Please Enter at-least one file name'(001).
EXIT.
ENDIF.
*-- Upload data from Presentation Server to SAP
PERFORM upload_data.
END-OF-SELECTION.
*-- Frame the Body of the Email
PERFORM frame_mail_body.
*-- Send Mail
PERFORM send_mail.
FORM file_path USING fp_file TYPE any.
*-- Selects the directory list
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = fp_file
dyname = sy-cprog
dynumb = sy-dynnr
filetype = 'P'
location = 'P'
server = space.
ENDFORM. " file_path
FORM upload_data.
*-- Local data declaration
DATA: l_file TYPE string,
l_index TYPE sy-tabix,
*-- For holding the split file name
tl_splitfile TYPE STANDARD TABLE OF rlgrap-filename,
wl_splitfile TYPE rlgrap-filename.
l_file = p_attach.
**-- Function module to split the Filename and Extension from the Path
CALL FUNCTION 'CH_SPLIT_FILENAME'
EXPORTING
complete_filename = l_file
IMPORTING
extension = w_extn
name = w_file.
*-- Split the filename at '.'
SPLIT l_file AT '.' INTO TABLE tl_splitfile.
DESCRIBE TABLE tl_splitfile LINES l_index.
*-- In case the filename contains more than one dot
IF l_index GT 2.
CLEAR: wl_splitfile, w_extn.
*-- Get the Extension of the file
READ TABLE tl_splitfile INTO wl_splitfile INDEX l_index.
w_extn = wl_splitfile.
DELETE tl_splitfile INDEX l_index.
DELETE tl_splitfile INDEX 1.
CLEAR wl_splitfile.
*-- Get the Actual filename
LOOP AT tl_splitfile INTO wl_splitfile.
CONCATENATE '.' wl_splitfile INTO wl_splitfile.
ENDLOOP.
CONCATENATE w_file wl_splitfile INTO w_file.
ENDIF.
CONDENSE w_extn.
*-- Upload File
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'BIN'
TABLES
data_tab = t_mailhex
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc IS NOT INITIAL.
MESSAGE i999(zz) WITH 'Error in reading file for upload'(002)
w_file.
ENDIF.
ENDFORM. " upload_data
FORM frame_mail_body.
*-- Local data declaration to hold the textpool
DATA: tl_textpool TYPE STANDARD TABLE OF textpool,
wl_textpool TYPE textpool.
*-- Read the Entire Textpool into an Internal table
READ TEXTPOOL sy-repid INTO tl_textpool LANGUAGE sy-langu.
IF sy-subrc IS INITIAL.
SORT tl_textpool BY id key.
ENDIF.
*-- Font start
CLEAR wa_contents.
wa_contents-line = c_style_start.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- Program name : Email Attachment
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T03'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
*-- "#" Present in the Text Element will be replaced by the below value
REPLACE: '#' WITH 'Email Attachment' INTO wa_contents-line.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- You can also change or add the text here...
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T04'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- For giving spaces between texts, you can use...
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T05'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- For Ex; Employee Numbers :
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T06'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
*-- How to give Spaces in between texts
CONCATENATE wa_contents-line c_space c_emp1 c_space c_emp2
c_space c_emp3 INTO wa_contents-line.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- For more Information on HTML..
CLEAR: wl_textpool, wa_contents.
READ TABLE tl_textpool INTO wl_textpool
WITH KEY id = 'I' key = 'T07'
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_contents-line = wl_textpool-entry.
APPEND wa_contents TO t_contents.
ENDIF.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- New line
CLEAR wa_contents.
wa_contents-line = c_new_line.
APPEND wa_contents TO t_contents.
*-- Hyperlink
CLEAR wa_contents.
CONCATENATE c_link_start c_link_text c_link_end INTO wa_contents-line.
APPEND wa_contents TO t_contents.
*-- Subject of the Mail
CONCATENATE text-t08 w_mail_subj INTO w_mail_subj.
ENDFORM. " frame_mail_body
FORM send_mail.
*-- Local data declaration for sending mail
DATA: l_send_request TYPE REF TO cl_bcs,
l_document TYPE REF TO cl_document_bcs,
l_sender TYPE REF TO cl_sapuser_bcs,
l_sub TYPE char50,
l_recipient TYPE REF TO if_recipient_bcs,
tl_contents TYPE STANDARD TABLE OF soli,
l_doc_len TYPE so_obj_len,
l_cnt TYPE sy-tabix,
l_rcv_email TYPE adr6-smtp_addr,
l_result TYPE sy-binpt,
l_bcs_exception TYPE REF TO cx_bcs,
l_subj TYPE string,
wl_mailid LIKE LINE OF s_mailid.
TRY.
*-- Create persistent send request
l_send_request = cl_bcs=>create_persistent( ).
tl_contents[] = t_contents[].
*-- Get the length of the Document
DESCRIBE TABLE tl_contents LINES l_cnt.
READ TABLE tl_contents INTO wa_contents INDEX l_cnt.
l_doc_len = ( l_cnt - 1 ) * 255 + STRLEN( wa_contents ).
*-- Subject of the mail
l_sub = w_mail_subj.
*-- Create Document
l_document = cl_document_bcs=>create_document(
i_type = c_htm
i_text = tl_contents
i_length = l_doc_len
i_subject = l_sub
i_language = sy-langu
i_importance = '1' ).
*-- Subject of the mail
MOVE w_mail_subj TO l_subj.
w_document = l_document.
TRY.
*-- Set the Message Subject
CALL METHOD l_send_request->set_message_subject
EXPORTING
ip_subject = l_subj.
CATCH cx_sy_dyn_call_illegal_method.
ENDTRY.
*-- Add document to send request
CALL METHOD l_send_request->set_document( l_document ).
*-- Do send delivery info for successful mails
CALL METHOD l_send_request->set_status_attributes
EXPORTING
i_requested_status = 'E'
i_status_mail = 'A'.
*-- Set sender
l_sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD l_send_request->set_sender
EXPORTING
i_sender = l_sender.
*-- To frame the attachments for the mail
PERFORM frame_attachments.
*-- Add the recipients to the Send mail
LOOP AT s_mailid INTO wl_mailid.
l_rcv_email = wl_mailid-low.
CHECK NOT l_rcv_email IS INITIAL.
l_recipient = cl_cam_address_bcs=>create_internet_address(
l_rcv_email ).
CALL METHOD l_send_request->add_recipient
EXPORTING
i_recipient = l_recipient
i_express = 'X'.
ENDLOOP.
*-- Send Email
CALL METHOD l_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = l_result ).
IF l_result = 'X'.
MESSAGE s999(zz) WITH
'Approval Mail Sent Successfully'(003).
ENDIF.
CATCH cx_bcs INTO l_bcs_exception.
IF l_result NE 'X'.
MESSAGE s999(zz) WITH
'Approval Mail Not Successful'(004).
ENDIF.
ENDTRY.
COMMIT WORK. "Commit Work
ENDFORM. " send_mail
FORM frame_attachments.
*-- Local Data declaration
DATA: l_subject TYPE so_obj_des,
l_att_type TYPE soodk-objtp.
*-- Subject of the Attachment
l_subject = w_file.
*-- Format of the Attachment
l_att_type = w_extn.
IF t_mailhex[] IS NOT INITIAL.
TRY.
*-- Add Attachment to the Document
CALL METHOD w_document->add_attachment
EXPORTING
i_attachment_type = l_att_type
i_attachment_subject = l_subject
i_att_content_hex = t_mailhex.
CATCH cx_document_bcs.
ENDTRY.
ENDIF.
ENDFORM. " frame_attachments
Thanks,
Jyotsna -
A strange problem in text element
Hi,
I developing a smartforms in ECC 6.0.
In this i created a simple text element where i write:
Order numer &LS_VBAK-VBELN&
Then when i save or active the smartforms automatically in the text element the space between has being deleted as so:
Order numer&LS_VBAK-VBELN&
Why?
Thanks lot.
Matteo VernileHi
If u r giving space in between Order numer AND &LS_VBAK-VBELN& then it should come
OTHERWISE
make a template and in that make two colum and
create 2 text element and
put the static data in one text and the dynamic data in another text.
let say
text1------ Order numer
text2----
&LS_VBAK-VBELN&
hope this will solve ur problem
Thanks
Krushna -
Hi there
Hope everyone is doing well
I have been using the addt looper wizard and it works great.....
I usually put all the things I want to loop into one cell.... then select all the things and apply the looper.... which works fine....
But..... it is hard to align all the elements I want to loop
I have been using transparent gif images to space the loops evenly but when I space dynamic taxt on top of each other there is a large gap.....
It is a nightmare to get it looking even
Ok say I want to loop this.....
A thumbnail
Product ID
Price
It would look like this
A thumbnail
Product ID
Price
Because I cannot reduce the space between the lines......
So I would like to place all the different elements in separate table cells and loop them..... I have tried and get really strange results....
When you look at most online shops, their product pages have a thumbnail image the id, price, description, etc.... all spaced evenly.... and looks like is looped...... So.... how do I do it?
Is there any easier way to align the things I want to loop?
Any help would be greatHi there
I seem to have figured out how to loop cells....
Should have thought of it earliar but anyway
Was easy....
Just create a looped (repeat) region and insert a table into the region and edit the table to align all the looped elements easily....
Cool -
Please help me in creating a form using Swing.
(I m sorry if I've posted similar post in some other thread.I am new to this forum..:))
There are several problems which I am facing while coding a form.
1. In the form I have one JComboBox
of Country and other of State. Now I want it in such a way that when
I select a country from the Country JComboBox ,the corresponding states
automatically appears in the State JComboBox.
2. I need to add picture frame in the 6th tab so that the picture shows up when clicked browse and open.
3.I need to add tables in 1st and 5th tab which shows up the details through database when added through several textboxes and combo boxes.
so please help me!
Here's my code
==========================================================
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JCheckBox;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.Box;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Design extends JFrame
public Design()
super("Tenant Form");
setLayout(new BorderLayout());
JTabbedPane tabbedPane=new JTabbedPane(); //creating tabbed buttons
//<--------coding for first tab--------->
JPanel panel1=new JPanel();
tabbedPane.addTab("Detail of Landlord",null,panel1,"first tab"); //here panel1 is created for tab1
GridBagConstraints gbc=new GridBagConstraints();
gbc.insets=new Insets(2,2,2,2);
gbc.anchor=GridBagConstraints.WEST;
JPanel jp11 = new JPanel(); //1st panel in 1st tab for top labels and buttons
jp11.setLayout(new GridBagLayout());
JLabel l241 = new JLabel("Name Of LandLord");
jp11.add(l241,gbc);
JComboBox jc01=new JComboBox();
jc01.addItem("Select");
jc01.addItem("Mr.");
jc01.addItem("Mrs.");
gbc.gridx=1;
jp11.add(jc01,gbc);
JTextField f01=new JTextField(10);
gbc.gridx=2;
jp11.add(f01,gbc);
JLabel l251 = new JLabel("Sex");
gbc.gridx=5;
gbc.insets=new Insets(2,20,2,2);
jp11.add(l251,gbc);
JComboBox jc11=new JComboBox();
jc11.addItem("Select");
jc11.addItem("Male");
jc11.addItem("Female");
gbc.gridx=6;
gbc.insets=new Insets(2,2,2,2);
jp11.add(jc11,gbc);
JLabel l261 = new JLabel("Age(Yrs)");
gbc.gridx=8;
gbc.insets=new Insets(2,20,2,2);
jp11.add(l261,gbc);
JTextField f11=new JTextField(3);
gbc.gridx=9;
gbc.insets=new Insets(2,2,2,2);
jp11.add(f11,gbc);
JLabel l271 = new JLabel("Occupation");
gbc.gridx= 11;
gbc.insets=new Insets(2,20,2,2);
jp11.add(l271,gbc);
JComboBox jc21=new JComboBox();
jc21.addItem("Select");
jc21.addItem("Engineer");
jc21.addItem("Business");
gbc.gridx=12;
gbc.insets=new Insets(2,2,2,2);
jp11.add(jc21,gbc);
JButton ab1=new JButton("ADD");
gbc.gridx=14;
gbc.insets=new Insets(2,20,2,2);
jp11.add(ab1,gbc);
panel1.add(jp11);
//<--coding for adding table with scroll pane #yet to be coded#-->
JTable jtab1=new JTable();
//start of p21 panel. 1st of two titledborder panels in tab 1
JPanel jp21=new JPanel();
jp21.setBorder(new TitledBorder("Address Of Landlord Property"));
jp21.setLayout(new GridBagLayout());
JLabel l11=new JLabel("Property/House/Building Address");
gbc.gridx=0;
gbc.gridy=0;
jp21.add(l11,gbc);
JTextArea ta11=new JTextArea(3,15);
ta11.setLineWrap(true);
int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
JScrollPane scroll11=new JScrollPane(ta11,v,h);
gbc.gridx=1;
jp21.add(scroll11);
jp21.add(ta11,gbc);
JLabel l21=new JLabel("Land Mark");
gbc.gridx=0;
gbc.gridy=1;
gbc.ipady=0;
gbc.gridheight=1;
jp21.add(l21,gbc);
JTextField tf21=new JTextField(15);
gbc.gridx=1;
gbc.gridy=1;
jp21.add(tf21,gbc);
JLabel l31=new JLabel("Country");
gbc.gridx=0;
gbc.gridy=2;
jp21.add(l31,gbc);
JComboBox c11=new JComboBox();
c11.addItem("India");
c11.addItem("US");
c11.addItem("Australia");
gbc.gridx=1;
gbc.gridy=2;
jp21.add(c11,gbc);
JLabel l41=new JLabel("State");
gbc.gridx=0;
gbc.gridy=3;
jp21.add(l41,gbc);
JComboBox c21=new JComboBox();
c21.addItem("Rajasthan");
c21.addItem("Delhi");
c21.addItem("Maharastra");
gbc.gridx=1;
gbc.gridy=3;
jp21.add(c21,gbc);
JLabel l51=new JLabel("District");
gbc.gridx=0;
gbc.gridy=4;
jp21.add(l51,gbc);
JComboBox c31=new JComboBox();
c31.addItem("jaipur");
c31.addItem("ajmer");
c31.addItem("alwar");
gbc.gridx=1;
gbc.gridy=4;
jp21.add(c31,gbc);
JLabel l61=new JLabel("City/Town");
gbc.gridx=0;
gbc.gridy=5;
jp21.add(l61,gbc);
JTextField tf31=new JTextField(15);
gbc.gridx=1;
gbc.gridy=5;
jp21.add(tf31,gbc);
JLabel l71=new JLabel("Police District");
gbc.gridx=0;
gbc.gridy=6;
jp21.add(l71,gbc);
JComboBox c41=new JComboBox();
c41.addItem("Jaipur");
c41.addItem("Alwar");
c41.addItem("Ajmer");
gbc.gridx=1;
gbc.gridy=6;
jp21.add(c41,gbc);
JLabel l81=new JLabel("Police Circle");
gbc.gridx=0;
gbc.gridy=7;
jp21.add(l81,gbc);
JComboBox c51=new JComboBox();
c51.addItem("India");
c51.addItem("US");
c51.addItem("Australia");
gbc.gridx=1;
gbc.gridy=7;
jp21.add(c51,gbc);
JLabel l91=new JLabel("Police station");
gbc.gridx=0;
gbc.gridy=8;
jp21.add(l91,gbc);
JComboBox c61=new JComboBox();
c61.addItem("Bani Park");
c61.addItem("Raja Park");
c61.addItem("Malviya Nagar");
gbc.gridx=1;
gbc.gridy=8;
jp21.add(c61,gbc);
JLabel l101=new JLabel("Pin No.");
gbc.gridx=0;
gbc.gridy=9;
jp21.add(l101,gbc);
JTextField tf41=new JTextField(15);
gbc.gridx=1;
gbc.gridy=9;
jp21.add(tf41,gbc);
JLabel l111=new JLabel("Phone No.(R)");
gbc.gridx=0;
gbc.gridy=10;
jp21.add(l111,gbc);
JTextField tf51=new JTextField(15);
gbc.gridx=1;
gbc.gridy=10;
jp21.add(tf51,gbc);
//start of p31.2nd of two titledborder panels in tab 1
JPanel jp31=new JPanel();
jp31.setBorder(new TitledBorder("Address Of Landlord Office"));
jp31.setLayout(new GridBagLayout());
JLabel l121=new JLabel("Office Address");
gbc.gridx=0;
gbc.gridy=0;
jp31.add(l121,gbc);
JTextArea ta61=new JTextArea(3,15);
ta61.setLineWrap(true);
JScrollPane scroll2=new JScrollPane(ta61);
gbc.gridx=1;
gbc.gridy=0;
jp31.add(ta61,gbc);
JLabel l131=new JLabel("Country");
gbc.gridx=0;
gbc.gridy=1;
gbc.gridheight=1;
jp31.add(l131,gbc);
JComboBox c12=new JComboBox();
c12.addItem("India");
c12.addItem("US");
c12.addItem("Australia");
gbc.gridx=1;
gbc.gridy=1;
jp31.add(c12,gbc);
JLabel l141=new JLabel("State");
gbc.gridx=0;
gbc.gridy=2;
jp31.add(l141,gbc);
JComboBox c22=new JComboBox();
c22.addItem("Rajasthan");
c22.addItem("Delhi");
c22.addItem("Maharastra");
gbc.gridx=1;
gbc.gridy=2;
jp31.add(c22,gbc);
JLabel l151=new JLabel("District");
gbc.gridx=0;
gbc.gridy=3;
jp31.add(l151,gbc);
JComboBox c32=new JComboBox();
c32.addItem("jaipur");
c32.addItem("ajmer");
c32.addItem("alwar");
gbc.gridx=1;
gbc.gridy=3;
jp31.add(c32,gbc);
JLabel l161=new JLabel("City/Town");
gbc.gridx=0;
gbc.gridy=4;
jp31.add(l161,gbc);
JTextField tf71=new JTextField(15);
gbc.gridx=1;
gbc.gridy=4;
jp31.add(tf71,gbc);
JLabel l171=new JLabel("Police District");
gbc.gridx=0;
gbc.gridy=5;
jp31.add(l171,gbc);
JComboBox c42=new JComboBox();
c42.addItem("Jaipur");
c42.addItem("Alwar");
c42.addItem("Ajmer");
gbc.gridx=1;
gbc.gridy=5;
jp31.add(c42,gbc);
JLabel l181=new JLabel("Police Circle");
gbc.gridx=0;
gbc.gridy=6;
jp31.add(l181,gbc);
JComboBox c52=new JComboBox();
c52.addItem("India");
c52.addItem("US");
c52.addItem("Australia");
gbc.gridx=1;
gbc.gridy=6;
jp31.add(c52,gbc);
JLabel l191=new JLabel("Police station");
gbc.gridx=0;
gbc.gridy=7;
jp31.add(l191,gbc);
JComboBox c62=new JComboBox();
c62.addItem("Bani Park");
c62.addItem("Raja Park");
c62.addItem("Malviya Nagar");
gbc.gridx=1;
gbc.gridy=7;
jp31.add(c62,gbc);
JLabel l201=new JLabel("Pin No.");
gbc.gridx=0;
gbc.gridy=8;
jp31.add(l201,gbc);
JTextField tf81=new JTextField(15);
gbc.gridx=1;
gbc.gridy=8;
jp31.add(tf81,gbc);
JLabel l211=new JLabel("Phone No.(O)");
gbc.gridx=0;
gbc.gridy=9;
jp31.add(l211,gbc);
JTextField tf91=new JTextField(15);
gbc.gridx=1;
gbc.gridy=9;
jp31.add(tf91,gbc);
JLabel l221=new JLabel("Phone No.(M)");
gbc.gridx=0;
gbc.gridy=10;
gbc.gridheight=1;
jp31.add(l221,gbc);
JTextField tf101=new JTextField(15);
gbc.gridx=1;
gbc.gridy=10;
jp31.add(tf101,gbc);
JLabel l231=new JLabel("E-mail");
gbc.gridx=0;
gbc.gridy=11;
gbc.gridheight=1;
jp31.add(l231,gbc);
JTextField tf111=new JTextField(15);
gbc.gridx=1;
gbc.gridy=11;
jp31.add(tf111,gbc);
JPanel jp41=new JPanel(); //adding above two panels p21 and p31 to p41 panel.
jp41.setLayout(new BoxLayout(jp41,BoxLayout.X_AXIS));
jp41.add(jp21);
jp41.add(Box.createHorizontalStrut(50));
jp41.add(jp31);
panel1.add(jp41); //adding p41 panel to panel1
//<--------coding for second tab--------->
JPanel panel2 = new JPanel();
tabbedPane.addTab("Id of Landlord",null,panel2,"second tab");
panel2.setLayout(new FlowLayout());
//adding radiobutton above TitledBorder panel
JPanel jp02=new JPanel();
JLabel l12=new JLabel("Identity Known");
JRadioButton jrb12=new JRadioButton("Yes");
JRadioButton jrb22=new JRadioButton("No");
ButtonGroup bg12=new ButtonGroup();
bg12.add(jrb12);
bg12.add(jrb22);
jp02.add(l12);
jp02.add(jrb12);
jp02.add(jrb22);
//adding TitledBorder panel
JPanel jp12=new JPanel();
jp12.setBorder(new TitledBorder("Identity Detail"));
jp12.setLayout(new GridBagLayout());
gbc.insets=new Insets(5,5,5,5);
JLabel l22=new JLabel("Identity Card");
gbc.gridx=0;
gbc.gridy=0;
jp12.add(l22,gbc);
JTextField jtf12=new JTextField(10);
gbc.gridx=1;
jp12.add(jtf12,gbc);
JLabel l32=new JLabel("Date of Issue");
gbc.gridx=0;
gbc.gridy=1;
jp12.add(l32,gbc);
JTextField jtf22=new JTextField(10);
gbc.insets=new Insets(5,5,5,25);
gbc.gridx=1;
jp12.add(jtf22,gbc);
JLabel l42=new JLabel("Identity Number");
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=2;
jp12.add(l42,gbc);
JTextField jtf32=new JTextField(10);
gbc.gridx=3;
jp12.add(jtf32,gbc);
JLabel l52=new JLabel("Name Of Issuer");
gbc.gridx=0;
gbc.gridy=2;
jp12.add(l52,gbc);
JTextField jtf42=new JTextField(10);
gbc.insets=new Insets(5,5,5,25);
gbc.gridx=1;
jp12.add(jtf42,gbc);
JLabel l62= new JLabel("Place Of Issuer");
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=2;
jp12.add(l62,gbc);
JTextField jtf52=new JTextField(10);
gbc.gridx=3;
jp12.add(jtf52,gbc);
gbc.gridx=0;
gbc.gridy=2;
Box b12 =Box.createVerticalBox(); //adding both panels to vertica box and adding it to panel2
b12.add(jp02);
b12.add(jp12);
panel2.add(b12);
//<--------coding for third tab--------->
JPanel panel3 = new JPanel();
tabbedPane.addTab("Detail of Tenant",null,panel3,"third tab");
//adding panel for top data
JPanel jp13=new JPanel(); //jp13 panel for details above 3 TitledBorder panels
jp13.setLayout(new GridBagLayout());
JLabel l13=new JLabel("Name");
gbc.insets=new Insets(2,2,2,2);
gbc.gridx=0;
gbc.gridy=0;
jp13.add(l13,gbc);
JComboBox c13=new JComboBox();
c13.addItem("Select");
c13.addItem("Mr.");
c13.addItem("Mrs.");
gbc.gridx=1;
jp13.add(c13,gbc);
JTextField jtf13=new JTextField(16);
gbc.gridx=2;
gbc.gridwidth=2;
jp13.add(jtf13,gbc);
JLabel l23=new JLabel("Sex");
gbc.insets=new Insets(2,20,2,2);
gbc.gridx=4;
gbc.gridwidth=1;
jp13.add(l23,gbc);
JComboBox c23=new JComboBox();
c23.addItem("Select");
c23.addItem("Male");
c23.addItem("Female");
gbc.insets=new Insets(2,2,2,2);
gbc.gridx=5;
jp13.add(c23,gbc);
JLabel l33=new JLabel("Father/Mother/Husband's Name");
gbc.gridy=1;
gbc.gridx=0;
jp13.add(l33,gbc);
JComboBox c33=new JComboBox();
c33.addItem("Select");
c33.addItem("Mr.");
c33.addItem("Mrs.");
gbc.gridx=1;
jp13.add(c33,gbc);
JComboBox c43=new JComboBox();
c43.addItem("Select");
c43.addItem("Mr.");
c43.addItem("Mrs.");
gbc.gridx=2;
jp13.add(c43,gbc);
JTextField jtf23=new JTextField(10);
gbc.gridx=3;
jp13.add(jtf23,gbc);
JLabel l43=new JLabel("Age(Yrs)");
gbc.insets=new Insets(2,20,2,2);
gbc.gridx=4;
jp13.add(l43,gbc);
JTextField jtf33=new JTextField(3);
gbc.insets=new Insets(2,2,2,2);
gbc.gridx=5;
jp13.add(jtf33,gbc);
JLabel l53=new JLabel("Citizenship");
gbc.gridy=2;
gbc.gridx=0;
jp13.add(l53,gbc);
JComboBox c53=new JComboBox();
c53.addItem("Select");
c53.addItem("Indian");
c53.addItem("Australian");
gbc.gridx=1;
gbc.gridwidth=2;
jp13.add(c53,gbc);
JLabel l63=new JLabel("Occupation");
gbc.insets=new Insets(2,20,2,2);
gbc.gridx=4;
gbc.gridwidth=1;
jp13.add(l63,gbc);
JComboBox c63=new JComboBox();
c63.addItem("Select");
c63.addItem("Engineer");
c63.addItem("Doctor");
gbc.insets=new Insets(2,2,2,2);
gbc.gridx=5;
jp13.add(c63,gbc);
panel3.add(jp13);
JPanel jp23=new JPanel(); //first of 3 TitledBorder panels
jp23.setBorder(new TitledBorder("Local Address"));
jp23.setLayout(new GridBagLayout());
JLabel l73=new JLabel("Local Address");
gbc.gridx=0;
gbc.gridy=0;
jp23.add(l73,gbc);
JTextArea ta43=new JTextArea(3,10);
ta43.setLineWrap(true);
JScrollPane scroll13=new JScrollPane(ta43);
gbc.gridx=1;
gbc.gridy=0;
jp23.add(ta43,gbc);
JLabel l83=new JLabel("Country");
gbc.gridx=0;
gbc.gridy=1;
gbc.gridheight=1;
jp23.add(l83,gbc);
JComboBox c73=new JComboBox();
c73.addItem("India");
c73.addItem("US");
c73.addItem("Australia");
gbc.gridx=1;
gbc.gridy=1;
jp23.add(c73,gbc);
JLabel l93=new JLabel("State");
gbc.gridx=0;
gbc.gridy=2;
jp23.add(l93,gbc);
JComboBox c83=new JComboBox();
c83.addItem("Rajasthan");
c83.addItem("Delhi");
c83.addItem("Maharastra");
gbc.gridx=1;
gbc.gridy=2;
jp23.add(c83,gbc);
JLabel l103=new JLabel("District");
gbc.gridx=0;
gbc.gridy=3;
jp23.add(l103,gbc);
JComboBox c93=new JComboBox();
c93.addItem("jaipur");
c93.addItem("ajmer");
c93.addItem("alwar");
gbc.gridx=1;
gbc.gridy=3;
jp23.add(c93,gbc);
JLabel l113=new JLabel("City/Town");
gbc.gridx=0;
gbc.gridy=4;
jp23.add(l113,gbc);
JTextField tf53=new JTextField(10);
gbc.gridx=1;
gbc.gridy=4;
jp23.add(tf53,gbc);
JLabel l123=new JLabel("Police District");
gbc.gridx=0;
gbc.gridy=5;
jp23.add(l123,gbc);
JComboBox c103=new JComboBox();
c103.addItem("Jaipur");
c103.addItem("Alwar");
c103.addItem("Ajmer");
gbc.gridx=1;
gbc.gridy=5;
jp23.add(c103,gbc);
JLabel l133=new JLabel("Police Circle");
gbc.gridx=0;
gbc.gridy=6;
jp23.add(l133,gbc);
JComboBox c113=new JComboBox();
c113.addItem("India");
c113.addItem("US");
c113.addItem("Australia");
gbc.gridx=1;
gbc.gridy=6;
jp23.add(c113,gbc);
JLabel l143=new JLabel("Police station");
gbc.gridx=0;
gbc.gridy=7;
jp23.add(l143,gbc);
JComboBox c123=new JComboBox();
c123.addItem("Bani Park");
c123.addItem("Raja Park");
c123.addItem("Malviya Nagar");
gbc.gridx=1;
gbc.gridy=7;
jp23.add(c123,gbc);
JLabel l153=new JLabel("Pin No.");
gbc.gridx=0;
gbc.gridy=8;
jp23.add(l153,gbc);
JTextField tf63=new JTextField(10);
gbc.gridx=1;
gbc.gridy=8;
jp23.add(tf63,gbc);
JLabel l163=new JLabel("Phone No.(R)");
gbc.gridx=0;
gbc.gridy=9;
jp23.add(l163,gbc);
JTextField tf73=new JTextField(10);
gbc.gridx=1;
gbc.gridy=9;
jp23.add(tf73,gbc);
JLabel l173=new JLabel("E-mail");
gbc.gridx=0;
gbc.gridy=10;
gbc.gridheight=1;
jp23.add(l173,gbc);
JTextField tf83=new JTextField(10);
gbc.gridx=1;
gbc.gridy=10;
jp23.add(tf83,gbc);
JPanel jp33=new JPanel(); //second of 3 TitledBorder panels
jp33.setBorder(new TitledBorder("Permanent Address"));
jp33.setLayout(new GridBagLayout());
JLabel l183=new JLabel("Perm. Address");
gbc.gridx=0;
gbc.gridy=0;
jp33.add(l183,gbc);
JTextArea ta93=new JTextArea(5,10);
JScrollPane scroll23=new JScrollPane(ta43);
ta93.setLineWrap(true);
gbc.gridx=1;
gbc.gridy=0;
jp33.add(ta43,gbc);
JLabel l193=new JLabel("Country");
gbc.gridx=0;
gbc.gridy=1;
gbc.gridheight=1;
jp33.add(l193,gbc);
JComboBox c133=new JComboBox();
c133.addItem("India");
c133.addItem("US");
c133.addItem("Australia");
gbc.gridx=1;
gbc.gridy=1;
jp33.add(c133,gbc);
JLabel l203=new JLabel("State");
gbc.gridx=0;
gbc.gridy=2;
jp33.add(l203,gbc);
JComboBox c143=new JComboBox();
c143.addItem("Rajasthan");
c143.addItem("Delhi");
c143.addItem("Maharastra");
gbc.gridx=1;
gbc.gridy=2;
jp33.add(c143,gbc);
JLabel l213=new JLabel("District");
gbc.gridx=0;
gbc.gridy=3;
jp33.add(l213,gbc);
JComboBox c153=new JComboBox();
c153.addItem("jaipur");
c153.addItem("ajmer");
c153.addItem("alwar");
gbc.gridx=1;
gbc.gridy=3;
jp33.add(c153,gbc);
JLabel l223=new JLabel("City/Town");
gbc.gridx=0;
gbc.gridy=4;
jp33.add(l223,gbc);
JTextField tf103=new JTextField(10);
gbc.gridx=1;
gbc.gridy=4;
jp33.add(tf103,gbc);
JLabel l233=new JLabel("Police District");
gbc.gridx=0;
gbc.gridy=5;
jp33.add(l233,gbc);
JComboBox c163=new JComboBox();
c163.addItem("Jaipur");
c163.addItem("Alwar");
c163.addItem("Ajmer");
gbc.gridx=1;
gbc.gridy=5;
jp33.add(c163,gbc);
JLabel l243=new JLabel("Police Circle");
gbc.gridx=0;
gbc.gridy=6;
jp33.add(l243,gbc);
JComboBox c173=new JComboBox();
c173.addItem("India");
c173.addItem("US");
c173.addItem("Australia");
gbc.gridx=1;
gbc.gridy=6;
jp33.add(c173,gbc);
JLabel l253=new JLabel("Police station");
gbc.gridx=0;
gbc.gridy=7;
jp33.add(l253,gbc);
JComboBox c183=new JComboBox();
c183.addItem("Bani Park");
c183.addItem("Raja Park");
c183.addItem("Malviya Nagar");
gbc.gridx=1;
gbc.gridy=7;
jp33.add(c183,gbc);
JLabel l263=new JLabel("Pin No.");
gbc.gridx=0;
gbc.gridy=8;
jp33.add(l263,gbc);
JTextField tf113=new JTextField(10);
gbc.gridx=1;
gbc.gridy=8;
jp33.add(tf113,gbc);
JLabel l273=new JLabel("Phone No.(R)");
gbc.gridx=0;
gbc.gridy=9;
jp33.add(l273,gbc);
JTextField tf123=new JTextField(10);
gbc.gridx=1;
gbc.gridy=9;
jp33.add(tf123,gbc);
JLabel l283=new JLabel("phone No.(M)");
gbc.gridx=0;
gbc.gridy=10;
gbc.gridheight=1;
jp33.add(l283,gbc);
JTextField tf133=new JTextField(10);
gbc.gridx=1;
gbc.gridy=10;
jp33.add(tf133,gbc);
JPanel jp43=new JPanel(); //third of 3 TitledBorder panels
jp43.setBorder(new TitledBorder("Ex-Home Address"));
jp43.setLayout(new GridBagLayout());
JLabel l293=new JLabel("Address");
gbc.gridx=0;
gbc.gridy=0;
jp43.add(l293,gbc);
JTextArea ta143=new JTextArea(3,10);
ta143.setLineWrap(true);
JScrollPane scroll33=new JScrollPane(ta143);
gbc.gridx=1;
gbc.gridy=0;
jp43.add(ta143,gbc);
JLabel l303=new JLabel("Country");
gbc.gridx=0;
gbc.gridy=1;
gbc.gridheight=1;
jp43.add(l303,gbc);
JComboBox c193=new JComboBox();
c193.addItem("India");
c193.addItem("US");
c193.addItem("Australia");
gbc.gridx=1;
gbc.gridy=1;
jp43.add(c193,gbc);
JLabel l313=new JLabel("State");
gbc.gridx=0;
gbc.gridy=2;
jp43.add(l313,gbc);
JComboBox c203=new JComboBox();
c203.addItem("Rajasthan");
c203.addItem("Delhi");
c203.addItem("Maharastra");
gbc.gridx=1;
gbc.gridy=2;
jp43.add(c203,gbc);
JLabel l323=new JLabel("District");
gbc.gridx=0;
gbc.gridy=3;
jp43.add(l323,gbc);
JComboBox c213=new JComboBox();
c213.addItem("jaipur");
c213.addItem("ajmer");
c213.addItem("alwar");
gbc.gridx=1;
gbc.gridy=3;
jp43.add(c213,gbc);
JLabel l333=new JLabel("City/Town");
gbc.gridx=0;
gbc.gridy=4;
jp43.add(l333,gbc);
JTextField tf153=new JTextField(10);
gbc.gridx=1;
gbc.gridy=4;
jp43.add(tf153,gbc);
JLabel l343=new JLabel("Police District");
gbc.gridx=0;
gbc.gridy=5;
jp43.add(l343,gbc);
JComboBox c223=new JComboBox();
c223.addItem("Jaipur");
c223.addItem("Alwar");
c223.addItem("Ajmer");
gbc.gridx=1;
gbc.gridy=5;
jp43.add(c223,gbc);
JLabel l353=new JLabel("Police Circle");
gbc.gridx=0;
gbc.gridy=6;
jp43.add(l353,gbc);
JComboBox c233=new JComboBox();
c233.addItem("India");
c233.addItem("US");
c233.addItem("Australia");
gbc.gridx=1;
gbc.gridy=6;
jp43.add(c233,gbc);
JLabel l363=new JLabel("Police station");
gbc.gridx=0;
gbc.gridy=7;
jp43.add(l363,gbc);
JComboBox c243=new JComboBox();
c243.addItem("Bani Park");
c243.addItem("Raja Park");
c243.addItem("Malviya Nagar");
gbc.gridx=1;
gbc.gridy=7;
jp43.add(c123,gbc);
JLabel l373=new JLabel("Pin No.");
gbc.gridx=0;
gbc.gridy=8;
jp43.add(l373,gbc);
JTextField tf163=new JTextField(10);
gbc.gridx=1;
gbc.gridy=8;
jp43.add(tf163,gbc);
JLabel l383=new JLabel("Phone");
gbc.gridx=0;
gbc.gridy=9;
jp43.add(l383,gbc);
JTextField tf173=new JTextField(10);
gbc.gridx=1;
gbc.gridy=9;
jp43.add(tf173,gbc);
JLabel l393=new JLabel("Leaving Date");
gbc.gridx=0;
gbc.gridy=10;
gbc.gridheight=1;
jp43.add(l393,gbc);
JTextField tf183=new JTextField(10);
gbc.gridx=1;
gbc.gridy=10;
jp43.add(tf183,gbc);
/*JCheckBox cb13=new JCheckBox("Approx");
gbc.gridx=2;
gbc.gridy=10;
jp43.add(cb13);*/
JPanel jp53=new JPanel(); //panel for addin all 3 TitledBorder panels
jp53.setLayout(new BoxLayout(jp53,BoxLayout.X_AXIS));
jp53.add(jp23);
jp53.add(Box.createHorizontalStrut(30)); //giving space between each TitledBorder panel
jp53.add(jp33);
jp53.add(Box.createHorizontalStrut(30));
jp53.add(jp43);
panel3.add(jp53); //adding panel which contains all 3 TitledBorder panels to panel3
JPanel jp63=new JPanel(); //jp63 panel for bottom data
jp63.setBorder(new TitledBorder("Tennancy Start/End"));
JLabel l403=new JLabel("From Date");
jp63.add(l403);
JTextField jtf193=new JTextField(12);
jp63.add(jtf193);
JCheckBox jcb23=new JCheckBox("Approx");
jp63.add(jcb23);
JLabel l413=new JLabel("To Date");
jp63.add(l413);
JTextField jtf203=new JTextField(12);
jp63.add(jtf203);
JCheckBox jcb33=new JCheckBox("Approx");
jp63.add(jcb33);
panel3.add(jp63); //adding bottom details panel jp63 to panel3
//<--------coding for fourth tab--------->
JPanel panel4 = new JPanel();
tabbedPane.addTab("Id of Tenant",null,panel4,"fourth tab");
panel4.setLayout(new FlowLayout());
//adding radiobutton above TitledBorder panel jp14
JPanel jp04=new JPanel();
JLabel l14=new JLabel("Identity Known");
JRadioButton jrb14=new JRadioButton("Yes");
JRadioButton jrb24=new JRadioButton("No");
ButtonGroup bg14=new ButtonGroup();
bg14.add(jrb14);
bg14.add(jrb24);
jp04.add(l14);
jp04.add(jrb14);
jp04.add(jrb24);
//adding TitledBorder panel jp14
JPanel jp14=new JPanel();
jp14.setBorder(new TitledBorder("Identity Detail"));
jp14.setLayout(new GridBagLayout());
gbc.insets=new Insets(5,5,5,5);
JLabel l24=new JLabel("Identity Card");
gbc.gridx=0;
gbc.gridy=0;
jp14.add(l24,gbc);
JTextField jtf14=new JTextField(10);
gbc.gridx=1;
jp14.add(jtf14,gbc);
JLabel l34=new JLabel("Date of Issue");
gbc.gridx=0;
gbc.gridy=1;
jp14.add(l34,gbc);
JTextField jtf24=new JTextField(10);
gbc.insets=new Insets(5,5,5,25);
gbc.gridx=1;
jp14.add(jtf24,gbc);
JLabel l44=new JLabel("Identity Number");
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=2;
jp14.add(l44,gbc);
JTextField jtf34=new JTextField(10);
gbc.gridx=3;
jp14.add(jtf34,gbc);
JLabel l54=new JLabel("Name Of Issuer");
gbc.gridx=0;
gbc.gridy=2;
jp14.add(l54,gbc);
JTextField jtf44=new JTextField(10);
gbc.insets=new Insets(5,5,5,25);
gbc.gridx=1;
jp14.add(jtf44,gbc);
JLabel l64=new JLabel("Place Of Issuer");
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=2;
jp14.add(l64,gbc);
JTextField jtf54=new JTextField(10);
gbc.gridx=3;
jp14.add(jtf54,gbc);
gbc.gridx=0;
gbc.gridy=2;
Box b14=Box.createVerticalBox(); //adding both panels to panel4 in vertical box
b14.add(jp04);
b14.add(jp14);
panel4.add(b14);
//<--------coding for fifth tab--------->
JPanel panel5 = new JPanel();
tabbedPane.addTab("Info Of Other Members",null,panel5,"fifth tab");
JPanel jp15=new JPanel(); //top panel jp15 for details above add delete buttons
jp15.setLayout(new GridBagLayout());
JLabel l15=new JLabel("Name");
gbc.gridx=0;
gbc.gridy=0;
gbc.insets=new Insets(10,10,10,10);
jp15.add(l15,gbc);
JTextField jtf15=new JTextField(10);
gbc.gridx=1;
jp15.add(jtf15,gbc);
JLabel l25=new JLabel("Sex");
gbc.gridx=2;
gbc.insets=new Insets(10,80,10,10);
jp15.add(l25,gbc);
JComboBox jcb15=new JComboBox();
jcb15.addItem("Male");
jcb15.addItem("Female");
gbc.gridx=3;
gbc.insets=new Insets(10,10,10,10);
jp15.add(jcb15,gbc);
JLabel l35=new JLabel("Relation");
gbc.gridx=0;
gbc.gridy=1;
gbc.insets=new Insets(10,10,40,10);
jp15.add(l35,gbc);
JTextField jtf25=new JTextField(10);
gbc.gridx=1;
jp15.add(jtf25,gbc);
JLabel l45=new JLabel("Age");
gbc.gridx=2;
gbc.insets=new Insets(10,80,40,10);
jp15.add(l45,gbc);
JTextField jtf35 =new JTextField(10);
gbc.gridx=3;
gbc.insets=new Insets(10,10,40,10);
jp15.add(jtf35,gbc);
JPanel jp25=new JPanel(); //middle panel jp25 for adding "add" and "delete" buttons
JButton jb15=new JButton("Add");
JButton jb25=new JButton("Delete");
jp25.add(jb15);
jp25.add(jb25);
//adding table #yet to be coded#
Box b15=Box.createVerticalBox();
b15.add(jp15);
b15.add(jp25);
panel5.add(b15); //adding jp15 and jp25 to panel5 in vertical box
//<--------coding for sixth tab--------->
JPanel panel6 = new JPanel();
tabbedPane.addTab("Related To Office",null,panel6,"sixth tab");
panel6.setLayout(new GridBagLayout());
//adding 4 labels and textfields vertically
JLabel l16=new JLabel("Investigation Officer");
gbc.gridx=0;
gbc.gridy=0;
gbc.insets=new Insets(40,40,20,10);
panel6.add(l16,gbc);
JTextField jtf16 =new JTextField(10);
gbc.gridx=1;
gbc.insets=new Insets(40,20,20,40);
panel6.add(jtf16,gbc);
JLabel l26=new JLabel("S.No.");
gbc.gridx=0;
gbc.gridy=1;
gbc.insets=new Insets(10,40,20,10);
panel6.add(l26,gbc);
JTextField jtf26 =new JTextField(10);
gbc.gridx=1;
gbc.insets=new Insets(10,20,20,40);
panel6.add(jtf26,gbc);
JLabel l36=new JLabel("Page No.");
gbc.gridx=0;
gbc.gridy=2;
gbc.insets=new Insets(10,40,20,10);
panel6.add(l36,gbc);
JTextField jtf36 =new JTextField(10);
gbc.gridx=1;
gbc.insets=new Insets(10,20,20,40);
panel6.add(jtf36,gbc);
JLabel l46=new JLabel("Date");
gbc.gridx=0;
gbc.gridy=3;
gbc.insets=new Insets(10,40,20,10);
panel6.add(l46,gbc);
JTextField jtf46=new JTextField(10);
gbc.gridx=1;
gbc.insets=new Insets(10,20,20,40);
panel6.add(jtf46,gbc);
/* Canvas c16=new Canvas(); //creating a rectangle frame for adding image
Image i16=c.createImage(200,100);
gbc.gridx=2;
gbc.gridy=0;
gbc.insets=new Insets(40,20,20,40);
gbc.gridheight=3;
panel6.add(i16,gbc);*/
JButton jb16=new JButton("Browse"); //adding "browse" and "save" buttons
gbc.insets=new Insets(10,20,20,40);
gbc.gridy=3;
panel6.add(jb16,gbc);
JButton jb26=new JButton("Save");
gbc.insets=new Insets(50,20,20,40);
gbc.gridy=4;
panel6.add(jb26,gbc);
//<-------end of sixth tab------->
add(tabbedPane);
//lower panel for cancel button
JPanel jp1=new JPanel();
jp1.setLayout(new FlowLayout(FlowLayout.RIGHT));
JButton can=new JButton("Cancel"); //initialising cancel button
jp1.add(can);
add(jp1,BorderLayout.SOUTH);
class Blistener implements ActionListener // class for action listener
public void actionPerformed(ActionEvent ae)
Object obj=ae.getSource();
try{
if(obj == can) //condition for cancel button
System.exit(0);
}catch(Exception e)
{System.out.println(e);
public class Project
public static void main(String args[]) //main method for the program
Design tabbedwin= new Design();
tabbedwin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tabbedwin.setSize(900,700);
tabFirst things first. Next time please use the code formating tags when posting your code.
Secondly, we cant help you do your entire project or more specifically we cant do it for you. We can probably help you with one section at a time.
Thirdly, do not post your entire code. Create a Short, Self Contained, Compilable Example (SSCCE) that demonstrates the problem section, and that is independent of any third party libraries and can compiled instantly and tested.
Now, lets see if we can answer one problem here.
Ques 1. In the form I have one JComboBox of Country and other of State. Now I want it in such a way that whenI select a country from the Country JComboBox ,the corresponding states automatically appears in the State JComboBox.
Ans 1: Use an ItemListener or an ActionListener (javax.swing.event) for this. Once an item is selected, the event will be fired and then you populate your ComboBox with the requried data.
Ques 2. I need to add picture frame in the 6th tab so that the picture shows up when clicked browse and open.
Ans 2: You haven't created the JButton for the browse action, nor have you created the JLabel to show the picture in. Create the JButton, then the JLabel, attach an ActionListener to the button to listen for the button click, open a JFileChooser, select the image file, create an ImageIcon and pass the File object returned to it. Then call the JLabel.setIcon( the ImageIcon) to display the picture. You'll have to store the picture File information some where so can reference it when saving.
Ques 3.I need to add tables in 1st and 5th tab which shows up the details through database when added through several textboxes and combo boxes.
You need to do some reading. The Swing Tutorial has everything you need, from How to use Tables to How to connect to databases. There are also some examples in your JDK installation folder, ie, jdk/demos/jfc/tableExample. Here is the link to the swing tutorial on how to use Tables: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html. You find other useful links there.
ICE -
HI abapers,
In the function module 'REUSE_ALV_GRID_DISPLAY'
is there anyway by which i can bring print the title of the report in center.
reward points for all usefull ans.hi,
madhvi
u hv to do manually by giving spaces.
like,
I_GRID_TITLE = ' report title'.
u get title in center.
regards,
arpit
Edited by: Arpit Shah on Feb 15, 2008 5:30 PM
Maybe you are looking for
-
Opening Sony's ARA (RAW) format in PS Elements 9
I use PS Elements 9, with the Adober Camera Raw plug-in installed (ver. 6.5.0.216) but cannot open Sonly's ARW format file, (RAW from Sony's a6000 mirrorless camera). The Adobe support page for this plug-in shows that it's compatible with PSE 9 and a
-
Creation date of Purchase Document
Hi, While creation of PO, system picks current date by default but we can change the date or give back date. Can you tell me , we can fix some check where system does not accept back date PO creation. Thanks, Dharmveer
-
How do I install Encore with Creative Cloud?
Can't download Encore, even I have the Creative Cloud. There is no link in my Adobe CC App
-
Can't download adobe illustrator - comes up with retry
Hi, I need to download this tommorow though it keeps on saying retry can't find internet connection, I've done everything including putting my firewall down. My browser is safari and chrome used both of them didn't work PLEASE HELP ANY HELP MUCH APPR
-
Hello, I tried to search for this issue but never found the solution. In the meantime, it drives me mad......so please do respond if you know the answer. Here is the problem. I have a WDS setup for our home, time capsule as base and several airport e