Urgent : can help me in my search program( mofication of my program)
Requirements:
<u>Selection-Screen</u>:
Parameter: String field to enter a text
Select-option: to enter program names (value help shall be available)
<u>Program</u>:
The user shall enter a text and select one or serveral program names. (Search help for the pro-gram names.)
The coding of the selected programs than are searched for the entered string (text).
(nice to have, but not necessary: if the user makes a double click on a line of the result list (see below) it is jump into the ABAP editor an the coding is displayed in display mode).
Output:
Display in a ABAP list OR in a ALV list the program name, the line number and the coding / text auf the line, where the search term as found.
<u>My Program coding</u>
TABLES: trdir,rs38m.
PARAMETER : pa_text(30) type c.
SELECT-OPTIONS : so_name FOR trdir-name MATCHCODE OBJECT ZSH_EXAMPLE.
data: begin of jtab occurs 0,
line(300),
end of jtab.
data : wa like jtab.
DATA : rata LIKE trdir OCCURS 0 WITH HEADER LINE.
DATA : repid type sy-repid.
DATA : fval type trdir-name.
DATA : cnt type n.
DATA : off type n.
SELECT name FROM trdir INTO rata WHERE name IN so_name.
append rata.
ENDSELECT.
WRITE: /02 'PrgName', 53 'Text',95 'Line No'.
uline.
LOOP AT rata.
read report rata-name into jtab.
jtab-line = rata-name.
append jtab.
search jtab for pa_text.
if sy-subrc = 0.
WRITE : /02 rata-name, 50 pa_text,90 sy-tabix.
endif.
ENDLOOP.
*LOOP AT jtab.
*ENDLOOP.
AT LINE-SELECTION ******************
AT LINE-SELECTION.
get cursor value fval.
Set parameter id 'RID' field rata-name.
EDITOR-CALL FOR REPORT fval DISPLAY-MODE.
*read
*find
*search
The problem is that i can display the list of program which contains the given string....
but when I double click on the program name... its not displaying the code of particular particular program .
so anyone help me to modify my program or send me a new code
REPORT ZSEARCH_HELP
DATADEKLARATION *****
TYPE-POOLS: slis.
TABLES: tadir.
Tables
DATA: gt_output TYPE TABLE OF zstruct_output. (here create a search help in se11)
Structures
DATA: gs_output TYPE zstruct_output.
Fields
DATA: gv_mess TYPE text60.
Constants
CONSTANTS: gc_s TYPE msgty VALUE 'S',
gc_r3tr TYPE pgmid VALUE 'R3TR',
gc_prog TYPE trobjtype VALUE 'PROG'.
SELECTION SCREEN *****
SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE sel_txt.
SELECT-OPTIONS: s_repid FOR tadir-obj_name.
PARAMETERS: p_seatxt TYPE string.
SELECTION-SCREEN: END OF BLOCK sel.
SELECTION SCREEN VALUE HELP *****
REPID_LOW
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_repid-low.
call search help
PERFORM prog_search_help CHANGING s_repid-low.
REPID_HIGH
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_repid-high.
call search help
PERFORM prog_search_help CHANGING s_repid-high.
AT LINE-SELECTION *****
AT LINE-SELECTION.
line selection -> double click functionality
PERFORM jump_into_coding USING gs_output-prog gs_output-line.
INITIALIZATION ******
INITIALIZATION.
sel_txt = 'Date selection'(001).
s_repid-sign = 'I'.
s_repid-option = 'CP'.
s_repid-low = 'Z*'.
APPEND s_repid.
START-OF-SELECTION ******
START-OF-SELECTION.
CLEAR: gt_output[],
gs_output,
gv_mess.
select data and determine where search string is used
PERFORM select_progs CHANGING gt_output.
END-OF-SELECTION.
IF NOT gt_output[] IS INITIAL. "found data
display the found data
PERFORM display_data CHANGING gt_output.
ELSE. "no data was found
gv_mess = 'No data was found'(003).
MESSAGE gv_mess TYPE gc_s.
ENDIF.
SUB-ROUTINES *****
*& Form select_progs
Determine programs where the search string is used
--> pt_output Output data
FORM select_progs CHANGING pt_output LIKE gt_output.
DATA: BEGIN OF ls_progs,
prog TYPE programm,
END OF ls_progs.
DATA: lt_progs LIKE TABLE OF ls_progs.
select all progams into a internal table
SELECT obj_name
FROM tadir
INTO TABLE lt_progs
WHERE pgmid = gc_r3tr AND
object = gc_prog AND
obj_name IN s_repid.
IF sy-subrc = 0. "selection was successful
LOOP AT lt_progs INTO ls_progs.
search coding of the programms for the search string
PERFORM search_coding USING ls_progs-prog
CHANGING pt_output.
ENDLOOP.
ELSE. "selection was not successful -> error message
gv_mess = 'Search string not found in selected programs'(002).
MESSAGE gv_mess TYPE gc_s.
ENDIF.
ENDFORM. " select_progs
*& Form search_coding
search every selected program for the search string
-->PS_PROGS Program name
<--PT_OUTPUT output data
FORM search_coding USING pv_prog TYPE any
CHANGING pt_output LIKE gt_output.
DATA: lt_coding TYPE TABLE OF string,
lv_coding TYPE string.
CLEAR gs_output.
read coding into internal table
READ REPORT pv_prog INTO lt_coding.
IF sy-subrc = 0. "Coding was read
move program name
gs_output-prog = pv_prog.
search for search text
LOOP AT lt_coding INTO lv_coding.
SEARCH lv_coding FOR p_seatxt.
IF sy-subrc = 0.
move found line
gs_output-line = sy-tabix.
gs_output-text = lv_coding.
APPEND gs_output TO pt_output.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " search_coding
*& Form display_data
display the result data
<--PT_OUTPUT result data
FORM display_data CHANGING pt_output LIKE gt_output.
LOOP AT pt_output INTO gs_output.
WRITE: / gs_output-prog LEFT-JUSTIFIED NO-GAP,
gs_output-line,
gs_output-text.
HIDE: gs_output-prog, gs_output-line.
ENDLOOP.
DATA: lt_fieldcat TYPE TABLE OF slis_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'GT_OUTPUT'
I_STRUCTURE_NAME = 'ZSTMP_SEARCH_PROG'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = lt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = lt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = pt_output
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " display_data
*& Form prog_search_help
search help for program field
--> pv_repid program name
<-- p2 text
FORM prog_search_help CHANGING pv_repid TYPE any.
use standard function module
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
object_type = 'PROG'
object_name = pv_repid
ENCLOSING_OBJECT =
SUPPRESS_SELECTION = 'X'
VARIANT = ' '
LIST_VARIANT = ' '
DISPLAY_FIELD =
MULTIPLE_SELECTION =
SELECT_ALL_FIELDS = ' '
WITHOUT_PERSONAL_LIST = ' '
PACKAGE = ' '
use_alv_grid = ' '
IMPORTING
object_name_selected = pv_repid
ENCLOSING_OBJECT_SELECTED =
STRUCINF =
TABLES
OBJECTS_SELECTED =
RECORD_TAB =
EXCEPTIONS
cancel = 1
wrong_type = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " prog_search_help
*& Form jump_into_coding
jump into the coding
-->P_GS_OUTPUT_PROG text
-->P_GS_OUTPUT_LINE text
FORM jump_into_coding USING pv_prog TYPE program
pv_line TYPE any.
EDITOR-CALL FOR REPORT pv_prog DISPLAY-MODE.
ENDFORM. " jump_into_coding
Similar Messages
-
In my dock there was this weird program called "tutorial". While throwing away this program I had to fill in my password. Afterwards I tried to change my password, but my old password doesn't work anymore. Who can help?
What was this program for, or did you just assume it's something you shouldn't have and therefore arbitrarily decide to "throw it away"? Exactly how did you supposedly throw it away?
If you didn't change your administrator password, there's no reason it shouldn't work now, so that suggests you did something else, or changed it and then forgot what it was.
You can't recover that password; you can only change it. To do that, you would need to boot from your Snow Leopard DVD, choose your language, then choose Reset Password from the Utilities menu in the top menu bar. -
Calling search helps dynamically in module pool program
Hi Experts,
I have created two search helps. I need to call these search helps in my module pool program dynamically for a single field (i.e ZMATNR).
you might be known... if it is a single search help, we can assign that in field attributes.
But here... I need to call different search helps for a single field based on the condition.
Pls help me.
Thanks
RaghuHi,
Use the below function module and pass the search help created in search help field according to the condition.
Process on Value-request.
if condition = A.
call function " F4IF_FIELD_VALUE_REQUEST"
TABNAME =
FIELDNAME =
SEARCHHELP = "Mention search help created
Elseif Conditon =B.
call function " F4IF_FIELD_VALUE_REQUEST"
TABNAME =
FIELDNAME =
SEARCHHELP = "Mention search help created
Endif.
Regards,
Prabhudas -
Urgent please help, this program should work
Urgent please help.
I need to solve or I will be in big trouble.
This program works at my home computer which is not networked.
The hard disk was put onto another computer at another location whihc is networked. Here my program worked on Monday 14 october but since for the last two days it is not working without me changing any code. Why do I receive this error message???
Error: 500
Location: /myJSPs/jsp/portal-project2/processviewfiles_dir.jsp
Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:162)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)
Root cause:
java.lang.NullPointerException
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:132)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)foolishmatt,
The code is quit large.
to understand the program I think all the code needs to be examined.
I would need to send to you in an email.
Here is my e-mail
[email protected]
if you contact me than I can send the code to you.
Thank you in advance. -
Hi
I have a Iphone4 in using. I couldn't find Safary, E-mail and notes from my phone one day. I made this mistake when I want to delete some programe from my phone. Who can help I recovery my phone please.
ThanksHello, HenryWang2103.
Thank you for visiting Apple Support Communities.
The Safari, Email and Notes applications are native to the iOS and is unable to be deleted. Since this is the case, they are either in a folder on the iPhone, on another page or Restrictions are enabled. You can also search for these Apps on the iPhone by touching the screen and sliding your finger down. Here is some information regarding these features. The information about folders is located in the user guide below.
iPhone User Guide
iOS: Understanding Restrictions (Parental Controls)
http://support.apple.com/kb/HT4213
Cheers,
Jason H. -
Hello all.. I hope someone here can help. I recently downloaded some updates to my imac. Since then the computer starts but I get the home screen opening without the logon box. I can't open any programs or files and if I click on the Safari tab it disappears from the dock. I've tried rebooting with no joy.
I contacted technical help at Apple and was told to hold down the ctrl and alt keys with two other keys, I think the S or P keys when powering up. This worked
and the computer seemed fine but now the problem has reappeared. Is there a way to removed downloaded updates from the computer or revert it to an earlier state? Sorry for the long question. Hopefully one of you clever people can help. SimonClntxwhtby wrote:
Hay thank you for your time . I do that every time I know I am online. It says that I am up to date . I have found that I have 10.4.11 version, and that my boot version is 10.6.2, and that my kernel version is 8.11.1.
I have a hard drive icon on my desktop that says 10.6.2....
I use to have iphoto, it doesnt open anymore, it says there is 1.2gigs on that disk.There are many things on here that are the same way. Where do I start?
It's always good to go with one thing at a time and stay focused on that. Let's start with the OS you're running. Click on the Apple menu > About This Mac. What does it say under Mac OS X version ? -
I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.
You can force quit applications
>Force quit
if that does not work you can force quit a computer shut down by hold the power button for an extended period. -
I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?
Why not use an event
Add a While Loop, inside the loop add the Event Sructure.
Now in the event structure selecd the String Controls.value change event to
react
and the new value inside the event that you get,( connect to the String
indicator box.
On Sun, 10 Aug 2003 15:58:47 -0500 (CDT), WiltonFilho wrote:
> I would like to do a program that have one string control and one
> string indicator, any character that I type in the string control in
> the same time it will be appear in another string (indicator). How can
> help me?
>
> I would like to do a program that have one string control and one
> string indicator, any character that I type in the string control in
> the same time it will be appear in another string (indicator). How can
> help me?
>
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ -
I have an ipod classic 120gb...
Somehow I have managed to get mutiple duplicates.....
I had a computer crash... and I restore several songs from the cloud, and from my computer backup from an external drive...
and also, from past purchases on itunes...... some songs I had loaded from my own cd collection....and songs had overlapped......
I knew I had duplicates before the crash and never took care of it.... but now of course there are more...
I have taken care of the duplicates in itunes, by deleting them one by one..... I made the mistake of checking boxes then highlighting and doing a mass delete... thinking it would only delete my check boxes.... and loss a lot of music... so had to restore backups again....
so.......
Ipod......... how do I delete duplicates from the ipod, without loosing music from my ipod... I have lost music that is still there I believe on the Ipod that is not on my itunes... but I am not sure...and I can not find a search duplicates in itunes for Ipod.... can anyone help me on this... is there a way to do it, without going through 8 days of music line by line??
Thank youRestore the iPod and reload it from the library... Ah, but there might be media on the device that isn't in the library yes?
See Recover your iTunes library from your iPod or iOS device and a script called DeDuper which can help remove unwanted duplicates from iTunes if you end up needing to do a blanket recovery from the iPod. See this thread for background on DeDuper.
tt2 -
Who can help me :)--a problem with java program(reset problem in java )
I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
correspond to the black square.The code like this,first one is shapes:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class shapes extends JFrame {
private JPanel buttonPanel; // panel for buttons
private DrawPanel myPanel; // panel for shapes
private JButton resetButton;
private JComboBox colorComboBox;
private JRadioButton circleButton, squareButton;
private ButtonGroup radioGroup;
private JCheckBox filledButton;
private JSlider sizeSlider;
private boolean isShow;
private int shape;
private boolean isFill=true;
private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
"green", "lightgray", "magenta", "orange",
"pink", "red", "white", "yellow"}; // color names list in ComboBox
private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
Color.gray, Color.green, Color.lightGray, Color.magenta,
Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
public shapes() {
super("Draw Shapes");
// creat custom drawing panel
myPanel = new DrawPanel(); // instantiate a DrawPanel object
myPanel.setBackground(Color.white);
// set up resetButton
// register an event handler for resetButton's ActionEvent
resetButton = new JButton ("reset");
resetButton.addActionListener(
// anonymous inner class to handle resetButton events
new ActionListener() {
// draw a black filled square shape after clicking resetButton
public void actionPerformed (ActionEvent event) {
// call DrawPanel method setShowStatus and pass an parameter
// to decide if show the shape
myPanel.setShowStatus(true);
isShow = myPanel.getShowStatus();
shape = DrawPanel.SQUARE;
// call DrawPanel method setShape to indicate shape to draw
myPanel.setShape(shape);
// call DrawPanel method setFill to indicate to draw a filled shape
myPanel.setFill(true);
// call DrawPanel method draw
myPanel.draw();
myPanel.setFill(true);
myPanel.setForeground(Color.black);
}// end anonymous inner class
);// end call to addActionListener
// set up colorComboBox
// register event handlers for colorComboBox's ItemEvent
colorComboBox = new JComboBox(colorNames);
colorComboBox.setMaximumRowCount(5);
colorComboBox.addItemListener(
// anonymous inner class to handle colorComboBox events
new ItemListener() {
// select shape's color
public void itemStateChanged(ItemEvent event) {
if(event.getStateChange() == ItemEvent.SELECTED)
// call DrawPanel method setForeground
// and pass an element value of colors array
myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
myPanel.draw();
}// end anonymous inner class
); // end call to addItemListener
// set up a pair of RadioButtons
// register an event handler for RadioButtons' ItemEvent
squareButton = new JRadioButton ("Square", true);
circleButton = new JRadioButton ("Circle", false);
radioGroup = new ButtonGroup();
radioGroup.add(squareButton);
radioGroup.add(circleButton);
squareButton.addItemListener(
// anonymous inner class to handle squareButton events
new ItemListener() {
public void itemStateChanged (ItemEvent event) {
if (isShow==true) {
shape = DrawPanel.SQUARE;
myPanel.setShape(shape);
myPanel.draw();
}// end anonymous inner class
);// end call to addItemListener
circleButton.addItemListener(
// anonymous inner class to handle circleButton events
new ItemListener() {
public void itemStateChanged (ItemEvent event) {
if (isShow==true) {
shape = DrawPanel.CIRCLE;
myPanel.setShape(shape);
myPanel.draw();
else
System.out.println("Please click Reset button first");
}// end anonymous inner class
);// end call to addItemListener
// set up filledButton
// register an event handler for filledButton's ItemEvent
filledButton = new JCheckBox("Filled", true);
filledButton.addItemListener(
// anonymous inner class to handle filledButton events
new ItemListener() {
public void itemStateChanged (ItemEvent event) {
if (isShow==true) {
if (event.getStateChange() == ItemEvent.SELECTED) {
isFill=true;
myPanel.setFill(isFill);
myPanel.draw();
else {
isFill=false;
myPanel.setFill(isFill);
myPanel.draw();
else
System.out.println("Please click Reset button first");
}// end anonymous inner class
);// end call to addItemListener
// set up sizeSlider
// register an event handler for sizeSlider's ChangeEvent
sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
sizeSlider.setMajorTickSpacing(10);
sizeSlider.setPaintTicks(true);
sizeSlider.addChangeListener(
// anonymous inner class to handle sizeSlider events
new ChangeListener() {
public void stateChanged(ChangeEvent event) {
myPanel.setShapeSize(sizeSlider.getValue());
myPanel.draw();
}// end anonymous inner class
);// end call to addChangeListener
// set up panel containing buttons
buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
buttonPanel.add(resetButton);
buttonPanel.add(filledButton);
buttonPanel.add(colorComboBox);
JPanel radioButtonPanel = new JPanel();
radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
radioButtonPanel.add(squareButton);
radioButtonPanel.add(circleButton);
buttonPanel.add(radioButtonPanel);
// attach button panel & draw panel to content panel
Container container = getContentPane();
container.setLayout(new BorderLayout(10,10));
container.add(myPanel, BorderLayout.CENTER);
container.add(buttonPanel, BorderLayout.EAST);
container.add(sizeSlider, BorderLayout.SOUTH);
setSize(500, 400);
setVisible(true);
public static void main(String args[]) {
shapes application = new shapes();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}second one is drawpanel:
import java.awt.*;
import javax.swing.*;
public class DrawPanel extends JPanel {
public final static int CIRCLE = 1, SQUARE = 2;
private int shape;
private boolean fill;
private boolean showStatus;
private int shapeSize = 100;
private Color foreground;
// draw a specified shape
public void paintComponent (Graphics g){
super.paintComponent(g);
// find center
int x=(getSize().width-shapeSize)/2;
int y=(getSize().height-shapeSize)/2;
if (shape == CIRCLE) {
if (fill == true){
g.setColor(foreground);
g.fillOval(x, y, shapeSize, shapeSize);
else{
g.setColor(foreground);
g.drawOval(x, y, shapeSize, shapeSize);
else if (shape == SQUARE){
if (fill == true){
g.setColor(foreground);
g.fillRect(x, y, shapeSize, shapeSize);
else{
g.setColor(foreground);
g.drawRect(x, y, shapeSize, shapeSize);
// set showStatus value
public void setShowStatus (boolean s) {
showStatus = s;
// return showstatus value
public boolean getShowStatus () {
return showStatus;
// set fill value
public void setFill(boolean isFill) {
fill = isFill;
// set shape value
public void setShape(int shapeToDraw) {
shape = shapeToDraw;
// set shapeSize value
public void setShapeSize(int newShapeSize) {
shapeSize = newShapeSize;
// set foreground value
public void setForeground(Color newColor) {
foreground = newColor;
// repaint DrawPanel
public void draw (){
if(showStatus == true)
repaint();
}If any kind people who can help me.
many thanks to you!4 widgets???
maybe this is what you mean.
add this inside your actionPerformed method for the reset action
squareButton.setSelected(true);
colorComboBox.setSelectedIndex(0);
if not be more clear in your post. -
Hy dear!
My Iphone 5s doesn't work. When i power on appear searching the sim card, but doesn't connect to the operator. Who can help me? I reset the Iphone, but doesn't fix the probem.
ThanksHi dear!
I'm very disappointed with Apple products! I was 15 days without my Iphone 5, because it stopped working and the had to be replaced by authorized apple. Then i bought an iphone 5s in two days it stopped working. Doesn't read the sim card. I call to Apple suport and discovery that the model A1533 is not warranted in Brazil and need to be replaced, because there is a hardware problem. In a moment i don't have anyone Phone. Why Apple does not send other equipment equal to authorized to exchange my Iphone, because in Brasil doesn't have the same model? I liked a lot this Apple phone, but i can't use, i have one brand new, but doen'st work. I don't have anybody in USA to exchange in one Apple store. Please help me!
Thanks. -
Help! Safari keeps giving me a grey screen. I can't click on any search items. Any troubleshooting ideas out there?
Try clearing Safari's cache : Settings > Safari > Clear Cookies And Data (Clear Cache on iOS 4) and also Clear History
If that doesn't work then try closing Safari completely and then re-open it : from the home screen (i.e. not with Safari 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Safari app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
A third option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot. -
I hope you can help me. I purchased adobe captivate 8 on line and when I click on the email link to download, it comes up with 7 programs, some are 64 bit and some are not, my computer is 32 bit. I am not sure which of these 7 to download? All or just the 4 non 64 bit?
I tracked down the problem with the download and installation, my windows 7 was missing a file and after reinstalling windows everything worked out. The first 32 bit program in their list was used. I hope this can help others.
-
HELP! Can't Type in iTunes Search Bar or Anywhere else in iTunes
I recently updated to a new version and now I can't type in the search bar, edit song names, edit file info. etc. This is very frustrating. PLEASE HELP Thanks.
Have you tried running *Disk Utility* and asking it to verify/repair 'Permissions'? Whilst you are at it, get DU to verify your hard drive to make sure that it is ok.
If it passes all these tests and you still have the problem, post back. -
hello there, this is really urgent i would like to ask if there is a way to deactivate/lock my Mini Ipad because it was stolen, i hope you can provide me a way to do so, thank you for the support and i really hop you can help me, i bought this mini ipad not too long ago.
Unless you enabled Find My iPad on it before it was stolen then there isn't any way to locate it. If you did enable it then you could try locating and/or remotely wiping it either via http://icloud.com on a computer or Find My iPhone on another device - but that will only work if it's connected to a network and the device hasn't already been wiped and/or Find My iPad disabled on it.
If you haven't already done so then you should report it to the police. You should also change your iTunes account password, your email account passwords, and any passwords that you'd stored on websites/emails/notes etc., and if it was a cellular model you should also contact your carrier.
Maybe you are looking for
-
This causes us a problem every time we make a payment run. The supplier payment report says it cannot generate the payment as there are no bank details set up - however when I attempt to put in the details i get the message; "this entry already exist
-
Zen Micro Wired Remote Control Prob
Anybody having problems with their supplied zen micro wired remote control? Mine seems to be having a connection problem with the player, slight movements will cause breakages in the music, left earphones will cease playing out. Seems that some peopl
-
Hi, I am trying to gather statistics on a sample table dept.I created a statstable as follows begin DBMS_STATS.CREATE_STAT_TABLE ( 'scott' ,'dept_stats_tab'); end; But when i open the statstable "Dept_stats_tab" i am not able to understand the meanin
-
Listen to conversation in a call center
Hi and thanks for your help! I would like to know if this is possible to listen to a talk between a customer and a employe directly from a phone that is own by a supervisor? I have seen this: http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/uc_syst
-
Java.lang.ClassCastException in local lookups
hi, i have written two ejb projects named as proj1 and proj2. i deployed proj1 as EAR1 and proj2 as EAR2.(in same server) in proj1 Sessionbean1 i need to use(lookup) proj2 Sessionbean2 . <b>i have given jndi name for proj2 Sessionbean2 as "jndiproj2