Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

gmake OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m|sed "s

629006Jan 14 2011 — edited Jan 15 2011
Dear All,


I am trying to compile SIPp but i am facing this error

gmake OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m|sed "s/Power Macintosh/ppc/"` sipp
gmake[1]: Entering directory `/export/home/trunk'
gcc  -D__SUNOS -DSVN_VERSION="\"unknown\""       -I. -I/usr/local/ssl/include/  -c -o xp_parser.o xp_parser.c
/bin/sh: gcc: cannot execute
gmake[1]: *** [xp_parser.o] Error 1
gmake[1]: Leaving directory `/export/home/trunk'
gmake: *** [all] Error 2
please help me to solve this problem

Thanks

Comments

darrylburke
Probably not very efficient, but seems to work ... fairly clean imho :-)
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.SwingUtilities;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.plaf.basic.BasicTextPaneUI;
import javax.swing.text.BadLocationException;

public class LineHighlightTextPane {
   
   public LineHighlightTextPane () {
   }
   
   void makeUI () {
      
      JTextPane textPane = new JTextPane ();
      textPane.setUI (new LineHighlightTextPaneUI (textPane));
      
      JScrollPane scrollPane = new JScrollPane (textPane);
      
      JFrame frame = new JFrame ("Line Highlight Text Pane");
      frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
      frame.setSize (300, 300);
      
      frame.add (scrollPane, BorderLayout.CENTER);
      frame.setVisible (true);
   }
   
   public static void main (String[] args) {
      SwingUtilities.invokeLater (new Runnable () {
         public void run () {
            new LineHighlightTextPane ().makeUI ();
         }
      });
   }
}

class LineHighlightTextPaneUI extends BasicTextPaneUI {
   
   JTextPane tc;
   
   LineHighlightTextPaneUI (JTextPane t) {
      
      tc = t;
      tc.addCaretListener (new CaretListener () {
         public void caretUpdate (CaretEvent e) {
            
            tc.repaint ();
         }
      });
   }
   
   @Override
   public void paintBackground (Graphics g) {
      
      super.paintBackground (g);
      
      try {
         Rectangle rect = modelToView(tc, tc.getCaretPosition ());
         int y = rect.y;
         int h = rect.height;
         g.setColor (Color.YELLOW);
         g.fillRect (0, y, tc.getWidth (), h);
      } catch (BadLocationException ex) {
         ex.printStackTrace();
      }
   }
}
Is that what you wanted or have I misread the requirement?

db
camickr
Or some code that should work on any JTextComponent:

http://www.discoverteenergy.com/files/LinePainter.java
843806
Thanks a lot for the help guys! I was able to do exactly what I needed.
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 12 2011
Added on Jan 14 2011
3 comments
264 views