Using mouselistener and class extending jbutton

Hello,
I wondered if anyone could advice, I am trying wrote a class which lowers the border of a jbutton when the button is clicked, and stays lowered until clicked again. In the sameway as bold does in ms word.
I understand I can use setBorder(raised) or setBorder(lowered).
But I was unsure which method here to place this code.
Thank you
public class AddButton extends JButton implements MouseListener{
protected Border raised = new SoftBevelBorder(BevelBorder.RAISED);
     protected Border lowered = new SoftBevelBorder(BevelBorder.LOWERED);
public void mouseClicked(MouseEvent e) { }
public void mouseMoved(MouseEvent e) { }
public void mouseExited(MouseEvent e) { }
public void mouseReleased(MouseEvent e) { }
public void mouseEntered(MouseEvent e) { }
public void mousePressed(MouseEvent e) { }
public void mouseDragged(MouseEvent e) { }
}

import java.awt.*;
import javax.swing.border.Border;
import java.awt.event.*;
import javax.swing.*;
public class Test3 extends JFrame {
  Border rb = BorderFactory.createRaisedBevelBorder(),
         lb = BorderFactory.createLoweredBevelBorder();
  JButton jb1 = new JButton("I am Button"), jb2 = new JButton("Hear me roar");
  public Test3() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    content.setLayout(new FlowLayout());
    jb1.setBorder(rb);
    content.add(jb1);
    jb1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        jb1.setBorder(jb1.getBorder()==rb?lb:rb);
    jb2.setBorder(rb);
    content.add(jb2);
    jb2.addMouseListener(new MouseAdapter() {
      public void mouseReleased(MouseEvent me) {
        jb2.setBorder(jb2.getBorder()==rb?lb:rb);
    JToggleButton jtb = new JToggleButton("Toggley Button");
    content.add(jtb);
    setSize(300,300);
    setVisible(true);
  public static void main(String[] arghs) { new Test3(); }
}

Similar Messages

  • Difference between using FM and class in alv

    does anyone know what's the main difference between using FM to create alv  and using class to create alv?
    in what condition we usually use FM or class?

    using FM  we can create Classical and Interactive ALV Reports.
    The classes are used to create the ALV Reports with OOPS concept.
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/022ba607-0301-0010-e382-fdedca553f5f
    Editable ALV
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ec31e990-0201-0010-f4b6-c02d876ce033
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Reward Points if useful

  • Problems using a static class extending JSPDynPage

    When I use the pdk with netweaver for creating a new portal object and I want to create a new PortalComponent (JSPDynpage) the pdk generates me the next code:
    public class TestJspDynPage extends PageProcessorComponent {
      public DynPage getPage(){
          return new TestJspDynPageDynPage(); }
      public <b>static</b> class TestJspDynPageDynPage extends JSPDynPage{
        public void doInitialization(){ }
        public void doProcessAfterInput() throws PageException {}
        public void doProcessBeforeOutput() throws PageException {}
    Is there any reason for creating the new class that extends JSPDynPage static ?
    Regards.

    Hi,
    That is a common problem, all variables in your JSPDynPage, should be saved in IPortalComponentSession/HttpSession instead of having instance/class variables.
    http://help.sap.com/saphelp_nw70/helpdata/en/fc/f28f414141a709e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/a0/3b7f41009d020de10000000a1550b0/frameset.htm
    Greetings,
    Praveen Gudapati

  • Using JAXB for classes extending third party objects

    I am trying to use JMX WS connector in my project. I have stuck with a problem I cannot solve. For example, I have class
    public class TypedObjectName extends ObjectName
    I do not know how to annotate this class. If I am trying to use @XmlRootElement annotation and provide no-arg default constructor for this class, JAXB throws an error
    Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    javax.management.ObjectName does not have a no-arg default constructor.
    this problem is related to the following location:
    at javax.management.ObjectName
    at com.hp.usage.mgmt.naming.TypedObjectName
    I am not able to modify ObjectName because it is a part of jdk, third party class from javax.management. I need to have this class in JAXB context since one my service has a method with this type, for example
    *public interface PerformanceMeasurement {*
    public TypedObjectName getJob();
    Any ideas to make it workable?

    Yes, right, I have seen this blog and if you read it carefully, there is a note rearding root object
    The root object case is not quite as clean. The result of the unmarshal operation will be the adapted object, then you will need to call the conversion code yourself.
    It means I need to change an API, in case of JMX WS Connector, instead of
    public interface PerformanceMeasurement {
    public TypedObjectName getJob();
    I will provide
    public interface PerformanceMeasurement {
    public TypedObjectNameAdapter getJob();
    Not sure that it is a good idea
    Edited by: tvv2000 on 03.02.2013 21:24

  • How to make a field manadatory within ALV Grid using methods and classes

    Hi,
    I am using ALV Grid using set_table_for_first_display
    inside my dialog programming. I have a field called project number inside my grid which has to be made as mandatory field.
    I have defined a method called catch_data_changed inside my class lcl_event_receiver. This method captures the changes made to one of the fields inside my ALV grid and displays all the default values of the other fields from the grid.
    Now, i have to make project number which is one of my fields inside my ALV grid as mandatory. At the field catalog level i did not find any such option for making a field as required field.
    Is there any other way, i can accomplish this within the ALV grid?

    from my understanding from ur question, i understood that u want the editable field inside alvgrid to be mandatory.
    i dont know anthing in fieldcat, but u can try the following logic.
    FORM DATA_CHANGED  USING P_ER_DATA_CHANGED TYPE REF TO
    CL_ALV_CHANGED_DATA_PROTOCOL .
      DATA: L_VALUE TYPE LVC_VALUE,
        ls_mod_cell type lvc_s_modi.
      READ TABLE P_ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MOD_CELL.
    if sy-subrc = 0.
        CALL METHOD P_ER_DATA_CHANGED->GET_CELL_VALUE
          EXPORTING
            I_ROW_ID    = LS_MOD_CELL-row_id
            I_FIELDNAME = LS_MOD_CELL-fieldname
          IMPORTING
            E_VALUE     = L_VALUE.
    IF LS_MOD_CELL-FIELDNAME <> 'fieldname what u want'
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.
    ELSE.
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.

  • Using inheritance and class indicator

    Hi
    I need help doing the following :
    I have a table with 2 types of data. I want to map it to 2 subclasses of the same superclass using the class indicator on an existing column.
    The problem is that i want to map all rows with value = 1 to 1 subclass and the rest of the rows (value != 1) to the second subclass.
    Can this be done ?
    Thanks
    Inbal

    Inbal,
    You will need to create a static method that takes a DatabaseRow and returns a Class, then specify this method using the api InheritancePolicy.setClassExtractionMethodName(String). In this method you will need to get the class indicator field from the databaseRow and return the Class that you want. You can also specify the class extraction method through the Mapping Workbench.
    Karen

  • How do you recognize JLabel pictures when using mouseListener

    Im doing a project where im making parcheesi. for this project im using mouseListener and JLabel images on top of JPanel squares. I need to be able to be able to recognize each color in order to either move the image or to create a new one. Any pointers on how to do this?

    It sounds like you're starting your game with the GUI. It's generally a better idea to get the actual workings of the game out of the way first and worry about the GUI last. A command line parcheesi game might not be pretty, but it's probably best to program your GUI independently of game function.
    For example, store the parcheesi board in a 2D array (or something of the sort) of chars. Then you can have a function the draws the board based on that array. Clicking and dragging would also use that array to paint the appropriate pieces. But like I said, that should be your last step.
    That's just me though. People tend to rush into the GUI part of a program, even after advised to do otherwise.

  • I want to make gImage Class extends Image and use Graphics2D

    Sorry, my english short...
    I want to make gImage Class extends Image and use Graphics2D
    I trying to do...
    make class gImage..
    extends Image class. (Inheritance)
    but Image class is abstract class..
    And I want to use gImage class same as Image class.
    I can't use constructor... because by Abstract calss...
    How do i?
    Help me.. plz...
    And I want to use Graphics2D at Applet Game, But not use Java JDK Plug-in...
    No Way?

    You need to use BufferedImage with 2D or RenderedImage with JAI.
    BufferedImage effectivley extends an Image so you can
    draw it to screen in paintCOmponent.
    I use an Extended JPanel to draw an image in a Panel with this.
    MArk

  • How to add mouseListener to classes and not to main, so each object is clic

    Hello everyone,
    Im developing a window system for applets. I know I could use the jframe windows but I want black outlined semi transparent windows. Im working on the basic stuff now. Basically you call the constructor and send it a string, the constructor will chop up the strings at '^' chars and determine the width and height of the window from there, anyway i can do all that.
    Is it possible to have each instance of my appletwindow class implement mouseListener and act upon mouse clicks separately or should i make a window manager and send mouse events from the main to my window manager? Of course if each object could have its own mouse handling that would save me having to iterate through all the objects every time there is a mouse click. Also do i need to extend component? Here is my code so far.
    public class AppletWindow extends Component implements MouseListener{
        String winText;
        Rectangle2D bounds;
        boolean isTop;
        Color bgColor;
        Color fgColor;
        int Margin;
        Font font;
        int fontHeight;
        int fontWidth;
        // some other contstructors here
        public AppletWindow(String winText, int x, int y)
            super();
            this.winText = new String();
            this.winText = winText;
            this.Margin = 10;
            this.fontHeight = 12;
            font = (new Font("SansSerif", Font.PLAIN, this.fontHeight));
            this.fontWidth = font.getSize()/2;
            int j = 0;
            int Width = 1;
            int Height = 1;
            for (int i=0; i<this.winText.length()-1; i++){
                if (this.winText.charAt(i) == '^'){    
                    if(Width < (i-j)){
                        Width = (i-j);
                    j=i;
                    Height++;
            } // end for
            this.bounds = new Rectangle(x, y,
                    Width*fontWidth+Margin*2,
                    Height*10+Margin*2 + fontHeight);
            this.bgColor = Color.BLACK;
            this.fgColor = Color.ORANGE;
            addMouseListener(this);
            boolean isTop = false;
        // all the mouse methods here
        // a method to paint the window to the screenIn my main (applet) i have these lines in the init()
      public void init() {
        this.setSize(800,600);
        testwin.addMouseListener(this);
        addMouseListener(this);
        } but when i click on the window or do anything to it, it does not respond. I had set up inside the appletwindow class so it would print out "applet window" on any mouse actions but none of them print.
    Thanks In advance

    Well i made my own window manager. So i pass the mouse events from the applet to the window manager and then to all the windows like so
    main (the appletscenemanager is my "window manager")
        AppletSceneManager asm = new AppletSceneManager();
        Thread repaintMe;
        // double buffering stuff
        Graphics bufferGraphics;
        Image offscreen;
        Dimension dim;
        public void init() {
        this.setSize(800,600);
        this.setBackground(Color.DARK_GRAY);
        dim = getSize();
        offscreen = createImage(dim.width,dim.height);
        bufferGraphics = offscreen.getGraphics();
        String winText = new String();
        int j = 0;
        int k = 0;
        for (int i=0; i< 25; i++){
            if(j==5){j=0;k++;}
            winText = "Window: " + i + '^';
            asm.addWindow(winText, j*160, k*120,160,120);
            j++;
        addMouseListener(this);
        addMouseMotionListener(this);
        public void mouseMoved(MouseEvent e) {
            //asm.processMouseEvent(e);
        public void mouseDragged(MouseEvent e) {
            asm.processMouseEvent(e);
        public void mousePressed(MouseEvent e) {
            asm.processMouseEvent(e);
        }then in my applet scene manager (which holds the windows in a linked list)
        public void processMouseEvent(MouseEvent e){
            AppletWindow temp = null;
            System.out.println("e.gid" + e.getID());
            for(AppletWindow aw :appletWindows){
                if(aw.processMouseEvent(e) != null)
                temp = aw;
            if (temp != null){
            appletWindows.remove(temp);
            appletWindows.push(temp);    
        }and in the actual window class its getting a little messy, its hard to tell which window is currenty being acted upon because i find if the window was clicked using .contains so if windows are on top of each other several can .contains(e.getpt()) and then several are "selected" at one time, which causes problems
        public AppletWindow processMouseEvent(MouseEvent e)
        if(dragging)
            moveWindow(e.getPoint());
            if (e.getID() != e.MOUSE_DRAGGED)
                dragging = false;
        if(sizing)
            sizingWindow(e.getPoint());
            if (e.getID() != e.MOUSE_DRAGGED)
                sizing = false;
        if(contains(e.getPoint()))
            // we are in this window pay attention
            if(e.getButton() == e.BUTTON1)
                setTopMost(true);                   // set it to topmost
                alpha = makeComposite(0.9F);        // make this one less transparent
            if(e.getID() == e.MOUSE_DRAGGED && isTopMost()  // are they draggin me?
                    && this.titleBounds.contains(e.getPoint())){dragging = true;}
            if(e.getID() == e.MOUSE_DRAGGED && isTopMost()
                        && this.sizeBounds.contains(e.getPoint())){sizing = true;}
            }else{
            setTopMost(false);
            alpha = makeComposite(0.5F);
            return this; // let them know it was us !
        return null; // it aint my fault!
        // window operations stuff
        public void moveWindow(Point pt){
            this.bounds.x = (int)(pt.getX() - (this.bounds.width/2));
            this.bounds.y = (int)(pt.getY()-5);
            this.titleBounds.setBounds(this.bounds.x, this.bounds.y,
                    this.bounds.width, fontHeight);
            this.sizeBounds.setBounds((int)this.bounds.getMaxX()-resizeWH,
                    (int)this.bounds.getMaxY()-resizeWH,resizeWH, resizeWH);
        public void sizingWindow(Point pt){
            if((pt.x - bounds.getMaxX()) > 0 && (pt.y - bounds.getMaxY()) > 0){
            this.bounds.width = (int)(bounds.width + (pt.x - bounds.getMaxX()));
            this.bounds.height = (int)(bounds.height + (pt.y - bounds.getMaxY()));
            }else{
            this.bounds.width = (int)(bounds.width - (bounds.getMaxX() - pt.x));
            this.bounds.height = (int)(bounds.height - (bounds.getMaxY() - pt.y));       
            this.titleBounds.setBounds(this.bounds.x, this.bounds.y,
                    this.bounds.width, fontHeight);
            this.sizeBounds.setBounds((int)this.bounds.getMaxX()-resizeWH,
                    (int)this.bounds.getMaxY()-resizeWH,resizeWH, resizeWH);
        public boolean contains(Point pt)
            if (bounds.contains(pt))
                return true;
            return false;
        }As anyone can see im getting no feedback what so ever from these forums (as usual), so i might be doing this the very hard way.
    here is the applet if anyone wants to see it run [http://www.zonemikel.com/smf/index.php?topic=18.0]

  • How to use the Rectangle class to draw an image and center it in a JPanel

    I sent an earlier post on how to center an image in a JPanel using the Rectangle class. I was asked to send an executable code which will show the malfunction. The code below is an executable code and a small part of a very big project. To simplifiy things, it is just a JFrame and a JPanel with an open dialog. Once executed the JFrame and the FileDialog will open. You can then navigate to a .gif or a .jpg picture and open it. What I want is for the picture to be centered in the middle of the JPanel and not the upper left corner. It is also important to stress that, I am usinig the Rectangle class to draw the Image. The region of interest is where the rectangle is created. In the constructor of the CenterRect class, I initialize the Rectangle class. Then I use paintComponent in the CenterRect class to draw the Image. The other classes are just support classes. The MyImage class is an extended image class which also has a draw() method. Any assistance in getting the Rectangle to show at the center of the JPanel without affecting the size and shape of the image will be greatly appreciated.
    I have divided the code into three parts. They are all supposed to be on one file in order to execute.
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class CenterRect extends JPanel {
        public static Rectangle srcRect;
        Insets insets = null;
        Image image;
        MyImage imp;
        private double magnification;
        private int dstWidth, dstHeight;
        public CenterRect(MyImage imp){
            insets = getInsets();
            this.imp = imp;
            int width = imp.getWidth();
            int height = imp.getHeight();
            ImagePanel.init();
            srcRect = new Rectangle(0,0, width, height);
            srcRect.setLocation(0,0);
            setDrawingSize(width, height);
            magnification = 1.0;
        public void setDrawingSize(int width, int height) {
            dstWidth = width;
            dstHeight = height;
            setSize(dstWidth, dstHeight);
        public void paintComponent(Graphics g) {
            Image img = imp.getImage();
         try {
                if (img!=null)
                    g.drawImage(img,0,0, (int)(srcRect.width*magnification), (int)(srcRect.height*magnification),
              srcRect.x, srcRect.y, srcRect.x+srcRect.width, srcRect.y+srcRect.height, null);
            catch(OutOfMemoryError e) {e.printStackTrace();}
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Opener().openImage();
    class Opener{
        private String dir;
        private String name;
        private static String defaultDirectory;
        JFrame parent;
        public Opener() {
            initComponents();
         public void initComponents(){
            parent = new JFrame();
            parent.setContentPane(ImagePanel.panel);
            parent.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            parent.setExtendedState(JFrame.MAXIMIZED_BOTH);
            parent.setVisible(true);
        public void openDialog(String title, String path){
            if (path==null || path.equals("")) {
                FileDialog fd = new FileDialog(parent, title);
                defaultDirectory = "dir.image";
                if (defaultDirectory!=null)
                    fd.setDirectory(defaultDirectory);
                fd.setVisible(true);
                name = fd.getFile();
                if (name!=null) {
                    dir = fd.getDirectory();
                    defaultDirectory = dir;
                fd.dispose();
                if (parent==null)
                    return;
            } else {
                int i = path.lastIndexOf('/');
                if (i==-1)
                    i = path.lastIndexOf('\\');
                if (i>0) {
                    dir = path.substring(0, i+1);
                    name = path.substring(i+1);
                } else {
                    dir = "";
                    name = path;
        public MyImage openImage(String directory, String name) {
            MyImage imp = openJpegOrGif(dir, name);
            return imp;
        public void openImage() {
            openDialog("Open...", "");
            String directory = dir;
            String name = this.name;
            if (name==null)
                return;
            MyImage imp = openImage(directory, name);
            if (imp!=null) imp.show();
        MyImage openJpegOrGif(String dir, String name) {
                MyImage imp = null;
                Image img = Toolkit.getDefaultToolkit().getImage(dir+name);
                if (img!=null) {
                    imp = new MyImage(name, img);
                    FileInfo fi = new FileInfo();
                    fi.fileFormat = fi.GIF_OR_JPG;
                    fi.fileName = name;
                    fi.directory = dir;
                    imp.setFileInfo(fi);
                return imp;
    }

    This is the second part. It is a continuation of the first part. They are all supposed to be on one file.
    class MyImage implements ImageObserver{
        private int imageUpdateY, imageUpdateW,width,height;
        private boolean imageLoaded;
        private static int currentID = -1;
        private int ID;
        private static Component comp;
        protected ImageProcessor ip;
        private String title;
        protected Image img;
        private static int xbase = -1;
        private static int ybase,xloc,yloc;
        private static int count = 0;
        private static final int XINC = 8;
        private static final int YINC = 12;
        private int originalScale = 1;
        private FileInfo fileInfo;
        ImagePanel win;
        /** Constructs an ImagePlus from an AWT Image. The first argument
         * will be used as the title of the window that displays the image. */
        public MyImage(String title, Image img) {
            this.title = title;
             ID = --currentID;
            if (img!=null)
                setImage(img);
        public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {
             imageUpdateY = y;
             imageUpdateW = w;
             imageLoaded = (flags & (ALLBITS|FRAMEBITS|ABORT)) != 0;
         return !imageLoaded;
        public int getWidth() {
             return width;
        public int getHeight() {
             return height;
        /** Replaces the ImageProcessor, if any, with the one specified.
         * Set 'title' to null to leave the image title unchanged. */
        public void setProcessor(String title, ImageProcessor ip) {
            if (title!=null) this.title = title;
            this.ip = ip;
            img = ip.createImage();
            boolean newSize = width!=ip.getWidth() || height!=ip.getHeight();
         width = ip.getWidth();
         height = ip.getHeight();
         if (win!=null && newSize) {
                win = new ImagePanel(this);
        public void draw(){
            CenterRect ic = null;
            win = new ImagePanel(this);
            if (win!=null){
                win.addIC(this);
                win.getCanvas().repaint();
                ic = win .getCanvas();
                win.panel.add(ic);
                int width = win.imp.getWidth();
                int height = win.imp.getHeight();
                Point ijLoc = new Point(10,32);
                if (xbase==-1) {
                    xbase = 5;
                    ybase = ijLoc.y;
                    xloc = xbase;
                    yloc = ybase;
                if ((xloc+width)>ijLoc.x && yloc<(ybase+20))
                    yloc = ybase+20;
                    int x = xloc;
                    int y = yloc;
                    xloc += XINC;
                    yloc += YINC;
                    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
                    count++;
                    if (count%6==0) {
                        xloc = xbase;
                        yloc = ybase;
                    int scale = 1;
                    while (xbase+XINC*4+width/scale>screen.width || ybase+YINC*4+height/scale>screen.height)
                        if (scale>1) {
                   originalScale = scale;
                   ic.setDrawingSize(width/scale, height/scale);
        /** Returns the current AWT image. */
        public Image getImage() {
            if (img==null && ip!=null)
                img = ip.createImage();
            return img;
        /** Replaces the AWT image, if any, with the one specified. */
        public void setImage(Image img) {
            waitForImage(img);
            this.img = img;
            JPanel panel = ImagePanel.panel;
            width = img.getWidth(panel);
            height = img.getHeight(panel);
            ip = null;
        /** Opens a window to display this image and clears the status bar. */
        public void show() {
            show("");
        /** Opens a window to display this image and displays
         * 'statusMessage' in the status bar. */
        public void show(String statusMessage) {
            if (img==null && ip!=null){
                img = ip.createImage();
            if ((img!=null) && (width>=0) && (height>=0)) {
                win = new ImagePanel(this);
                draw();
        private void waitForImage(Image img) {
        if (comp==null) {
            comp = ImagePanel.panel;
            if (comp==null)
                comp = new JPanel();
        imageLoaded = false;
        if (!comp.prepareImage(img, this)) {
            double progress;
            while (!imageLoaded) {
                if (imageUpdateW>1) {
                    progress = (double)imageUpdateY/imageUpdateW;
                    if (!(progress<1.0)) {
                        progress = 1.0 - (progress-1.0);
                        if (progress<0.0) progress = 0.9;
    public void setFileInfo(FileInfo fi) {
        fi.pixels = null;
        fileInfo = fi;
    }

  • How to use logging in the actions classes extends standart actions?

    Hello!
    I have some action classes extends standart actions, for example Z_ExtMaintainBasketDispatcherAction extends MaintainBasketDispatcherAction. I tried to use logging functionality in my classes but there were no my lines in log and trace files.
    For example I added followed lines in basketPerform() method of Z_ExtMaintainBasketDispatcherAction:
    boolean isDebugEnabled = log.isDebugEnabled();
    if(isDebugEnabled){
    log.debug("++++++++++++++++ Test tracing in B2B_SNG. ++++++++++++++++");
    but in there was no such line neither in log file nor in trace file.
    How I can use logging functionality in my own classes? I need it for tracing and logging.
    CRM 5.0
    regards, Lev

    Well, here is solution. I created a log formatter and log destination like this:
    <log-formatters>
    <log-formatter name="application_sap.com/crm~b2b" type="TraceFormatter" pattern="%d,%-3p %t %s %l %m"/>
    </log-formatters>
    <log-destinations>
    <log-destination name="application_sap.com_crm.b2b" type="FileLog"
        count="10" effective-severity="ALL" limit="10000000" pattern=".\log\applications\isa_ru.log">
    <formatter-ref name="application_sap.com/crm~b2b"/>
    </log-destination>
    </log-destinations>
    and new log controller like this:
    <log-controller effective-severity="ALL" name="ru.sng.isa">
    <associated-destinations>
    <destination-ref name="application_sap.com_crm.b2b" association-type="LOG"/>
    </associated-destinations>
    </log-controller>
    in file META-INF\log-configuration.xml
    Thanks everybody for help!
    Regards, Lev.

  • Extending JButton class , getting black text , Why??

    Hi,
    I'm extending the JButton class like this....
    public class JIconButton extends JButton {
    public JIconButton(String label, String file, Icon rollovericon) {
    super(label,new ImageIcon(file));
    etc...
    and when i construct a button from my new supercool :) JIconButton class everything works just fine but the label (text) on the button is black..
    why??
    what can I do to get the default (purple) color back???

    It's proabably reverting back to the system default which is 'black' if you set up purple, then it's not picking it up.
    Jus-a-litle idea:
    Write a more() function and call it again in ;-)
    void init more(){                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Using Timer and TimerTask classes in EJB's(J2EE)

    Does J2EE allow us to use Timer and TimerTask classes from java.util package in SessionBean EJB's ( Statless or Statefull )?.
    If J2EE does allow, I am not sure how things work in practical, Lets take simple example where a stateless SessionBean creates a Timer class
    and schedules a task to be executed after 5 hours and returns. Assuming
    GC kicks in many times in 5 hours, I wonder if the Timer object created by survives the GC run's so that it can execute the scheduled tasks.
    My gut feeling says that the Timer Object will not survive.. Just
    want to confirm that.
    I will be interested to know If there are any techiniques that can make
    the usage of Timer and TimeTask classes in EJB's possible as well as reliable with minmum impact on over all performance.

    Have a look at J2EE 1.4. I think they add a timer service for EJBs there...
    Kai

  • When I use Firefox and Hotmail at startup, Firefox freezes for about 1 minute, and then I can continue. First I though it was my computer but 2 other girls in my class have the same problem with Hotmail and Firefox. What can I do to change this?

    When I start Firefox, about 15 seconds after I start it, my Firefox freezes for about 1 minute. I found out that it is my Hotmail that makes Firefox freeze.
    First I thought it was my computer, but I have 2 other girls in my class that use Hotmail and Firefox and their computer also freezes for 1 full minute.
    This is very annoying, what can I do to change this?
    xxx ellen
    p.s. I am from the Netherlands, maybe that has something to do with it?

    Try deleting cookies and cache:
    1. Tools| Clear recent history
    2. Time range to clear: Everything
    3. If it isn't already selected, select '''Cookies''' and '''Cache'''
    4. '''Clear now'''
    '''Check cookie exceptions'''
    1. Tools | Options | Privacy Panel
    2. Set '''Firefox will: Use custom settings for history.''' '''Insure Accept cookies for sites and accept third-party cookies''' is selected
    3. Click '''Exceptions'''. If the misbehaving site is in that list, select it and click '''Remove site'''
    '''Safe Mode'''
    Add-ons can cause problems with not being able to log into certain websites. To see if this is the case with your issue, run [[Safe mode]]. When you get to the safe mode window, select Continue in Safe Mode. If this resolves your problem, see [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    Also see [[Updating Firefox]] and [[Cannot log in to websites]]

  • I have an Airport Extreme as my router and am using time capsule to extend the network in my new house. My ISP is only providing me 4-5 ip addresses and wants me to set up my router to issue out new ip addresses for all my devices.How do I fix this?Help

    I have an Airport Extreme as my router and am using time capsule to extend the network in my new house. My ISP is only providing me 4-5 ip addresses and wants me to set up my router to issue out new ip addresses for all my devices.How do I fix this?Help.
    They said I need to change my settings to NAT settings. I haven't been able to figure out or find anything. I have also spoken to Apple Support on the phone for hours without being able to figure out how to do this ( i don't think he knew much either lol.) Please help me because I've got about 15-20 devices in my house that require to be connected to the internet and this is just making things ridiculously slow and painful for me.
    Thanks!

    It is on DHCP & NAT under router mode yet my isp is still the one issuing ip addresses to my devices instead of the router issuing them

Maybe you are looking for