Etchasketch

I'm writing a program that will operate like an etchasketch, one that will draw on the JPanel using the arrow keys. The JPanel gets erased when the window is resized...as of now, I have this.
//EtchaSketch
//Feb 25, 2004
import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.event.*;
import java.awt.event.KeyEvent;
import java.awt.*;
import javax.swing.*;
public class EtchSketch extends JFrame implements KeyListener
     private JPanel label, sketcharea;
     private JLabel instruct;
     private int lastx = 250, lasty = 250, code;
     private final int size = 10;
EtchSketch()
     addWindowListener(new WindowAdapter()
     {public void windowClosing(WindowEvent e)
     {System.exit(0);}});
     //set up instructions
     JPanel label = new JPanel();
     label.setBackground(Color.white);
     JLabel instruct = new JLabel("<html>Use arrow keys to move about on the surface.<br>Hold the shift key down to draw on the surface with the arrow keys.<br>Your drawing will be erased if you resize the window.</html>");
     label.add(instruct);
     getContentPane().add(label, "North");
     //set up drawing board
     JPanel sketcharea = new JPanel(){
     public void paintComponent(java.awt.Graphics g) {
     super.paintComponent(g);
     Graphics2D g2 = (Graphics2D)g;
     g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
     RenderingHints.VALUE_ANTIALIAS_ON);
     g.setColor(Color.blue);
     if(code == KeyEvent.VK_UP){g2.fillRect(lasty = lasty-10, lastx, size, size);
     repaint();};
     if(code == KeyEvent.VK_DOWN){g2.fillRect(lasty = lasty+10, lastx, size, size);
     repaint();};
     if(code == KeyEvent.VK_RIGHT){g2.fillRect(lasty, lastx = lastx+10, size, size);
     repaint();};
     if(code == KeyEvent.VK_LEFT){g2.fillRect(lasty, lastx = lastx-10, size, size);
     repaint();};
     sketcharea.setOpaque(true);
     sketcharea.setBackground(Color.white);
     getContentPane().add(sketcharea, "Center");
public void keyPressed(java.awt.event.KeyEvent ke)
     int code = ke.getKeyEvent();
public void keyTyped(KeyEvent ke)
public void keyReleased(KeyEvent ke)
public static void main(String [] args){
     JFrame jf = new EtchSketch();
     jf.setSize(500, 500);
     jf.setVisible(true);
}at the moment I'm getting this error.
D:\root\Documents\Java\EtchSketch.java:61: cannot resolve symbol
symbol : method getKeyEvent ()
location: class java.awt.event.KeyEvent
     int code = ke.getKeyEvent();
^
1 error
Process completed.

hi, i'm doing a similar program as well, and I was
wondering where would I add that "this" code thing in
the progrma?As you're learning, it's important to figure out how to search the Internet and existing documentation to find your solution. For instance, the following should help you greatly in your cause:
Introduction to Event Listeners
http://javaalmanac.com/egs/java.awt.event/pkg.htmlThe Java Developers Almanac 1.4: java.awt.event

Similar Messages

  • My ipod basically restored itself and all i did was reset it! HELP PLEASE!

    okay, im so aggrivated right now. this is the SECOND time my ipod does this! UGH!
    so what happened was that my ipod froze. no big deal, it freezes every now and then. so i reset it, by pressing the sleep and home buttons and sliding the power off thingy, ive done this before. but for some reason this time when my ipod came back on, it gave me the screen that appears when you first get an ipod touch, you know, the itunes symbol with the cord pointing to it. so i plugged it into itunes, and it says that it has detected an ipod in 'recovery mode' and that i need to restore it, but if i resore it i lose EVERYTHING. and i sync manually, so itll take like a day to click and drag all my songs, and reinstall all my apps. ill restore it if i have to, but i just dont understand why this happened. and its the SECOND time! a while back, all i did was plug my ipod to itunes, nothing different, and it came up with ZERO songs, and ZERO videos. but everything else was there!
    so what do i do? this isnt something that should happen. do you guys think i should contact apple? is there something THEY can do? should i restore it? please help!
    btw, thank you if you actually read this whole ramble.

    okay so i restored my ipod, and reinstalled the apps. except for etchasketch, which said it encountered an error. but all my music is gone. ill resync that manually tomorrow because itll take a while. thank your for replying. but i dont think that the apple support wouldve done anything because my itouch is way older than 90 days. i got it for christmas last year but my parents had bought it in early december. but everythings fine now, i just REALLY dont want this to happen again!!
    oh and maybe it wont because i had just bought a new app, and just installed it when it froze, so maybe something was corrupted. thanks for the help.

  • 2.0 upgrade/operation woes

    I installed the 2.0 upgrade to my 16 GB Touch last night, but not without difficulty and continuing problems.
    The attempted backup did not work, as some have noted. (My particular issue was an error -43.) I finally gave up and let it upgrade anyway, thus losing all my safari and youtube bookmarks, wifi settings, and probably other stuff I haven't discovered yet. I tried multiple times after rebooting, disconnecting, powering on, restarting iTunes in various combinations. Even tried a different computer with access to the same library. Many attempts, no success.
    After restoring the library to the ipod, I noticed several things:
    1. The artwork was not downloaded for each song, even though it was all there before, and my library is the same, and the artwork shows up in iTunes for each and every song, it only appears in coverflow and song views for some. (There is a mix of mp3, m4a, and m4p files.)
    2. When using a finger to edit the cursor postion in a search, (in YouTube search, for example), the usual bubble appears with the cursor, but the text in the bubble quickly moves off of the top of the screen so that you can't find the cursor position.) I don't remember seeing this prior to the 2.0 software.
    3. I also purchased the EtchASketch app, which is fine, but sometimes after running EtchASketch, returning to the main menu, then rerunning EAS, it just sits on the title page and never leaves. The iPod is not hung up as I can return to the main menu, but EAS won't run properly again until I power down completely and start up again.
    The Touch is really my favorite "gadget" that I've purchased in recent history, but I'm very disappointed in this release with the glitches in upgrade and the glitches in operation. (Not to mention feeling a little bit taken advantage of in having purchased the $20 January upgrade to find that I've now paid a total of $30 for something that others now get for $10.)
    I'm hoping at least one of the problems, (the artwork), is some form of operator error, so I can get things back the way they were.
    Thanks for any suggestions you can offer, or news of impending fixes.

    I bought the 2.0 upgrade but can't install it. I get an error message "iphone 2.0 upgrade. You do not have enough priveledges for this operation". It's so weird, i bought it, it shows up as a download waiting for me but I can't download it. Any ideas out there to help with this would be appreciated. I put a support request through to apple a few days back but have not heard from them.

  • [SOLVED] tmux bash completion

    Hey,
    Looking through internet, I didn't find any solution. I want to be able to hit Tab on a terminal to complete my commands, like I do a million times a day.
    Except it doesn't work on tmux, Tab just does nothing at all.
    Here is my tmux.conf :
    #Make zsh default shell to use
    # set-option -g default-shell /bin/zsh
    # use UTF8
    set -g utf8
    set-window-option -g utf8 on
    # make tmux display things in 256 colors
    set -g default-terminal "screen-256color"
    # set scrollback history
    set -g history-limit 3000
    # shorten command delay
    set -sg escape-time 1
    # set window and pane index to 1 (0 by default)
    set-option -g base-index 1
    setw -g pane-base-index 1
    # reload ~/.tmux.conf
    bind -n C-q source-file ~/.tmux.conf \; display "Reloaded!"
    # Select and open URL
    bind -n C-u run tmux-url-select
    unbind-key Tab
    # split window horizontally and vertically
    bind -n C-v split-window -h
    bind -n C-h split-window -v
    # Make the current window the first window
    bind -n C-T swap-window -t 1
    # map Vi movement keys as pane movement keys
    bind -n C-Left select-pane -L
    bind -n C-Down select-pane -D
    bind -n C-Up select-pane -U
    bind -n C-Right select-pane -R
    # and use C-h and C-l to cycle thru panes
    bind -n C-o select-window -t :-
    bind -n C-i select-window -t :+
    # resize panes using PREFIX H, J, K, L
    bind -n C-N resize-pane -L 5
    bind -n C-J resize-pane -D 5
    bind -n C-K resize-pane -U 5
    bind -n C-L resize-pane -R 5
    # explicitly disable mouse control
    setw -g mode-mouse off
    set -g mouse-select-pane on
    set -g mouse-resize-pane on
    set -g mouse-select-window on
    # Copy & Paste
    # provide access to the clipboard for pbpaste, pbcopy
    #set-option -g default-command "reattach-to-user-namespace -l zsh"
    set-window-option -g automatic-rename on
    # use vim keybindings in copy mode
    setw -g mode-keys vi
    # setup 'v' to begin selection as in Vim
    bind-key -t vi-copy v begin-selection
    bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
    # update default binding of 'Enter' to also use copy-pipe
    unbind -t vi-copy Enter
    bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
    bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
    bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
    # set some pretty colors
    #set pane colors - hilight the active pane
    set-option -g pane-border-fg colour235 #base02
    set-option -g pane-active-border-fg red #base01
    # colorize messages in the command line
    set-option -g message-bg black #base02
    set-option -g message-fg brightred #orange
    # Status Bar
    set-option -g status off # turn the status bar on
    set -g status-utf8 on # set utf-8 for the status bar
    set -g status-interval 5 # set update frequencey (default 15 seconds)
    set -g status-justify centre # center window list for clarity
    # set-option -g status-position top # position the status bar at top of screen
    # visual notification of activity in other windows
    setw -g monitor-activity off
    set -g visual-activity off
    # set color for status bar
    set-option -g status-bg colour0
    set-option -g status-fg yellow #yellow
    set-option -g status-attr dim
    # set window list colors - red for active and cyan for inactive
    set-window-option -g window-status-fg brightblue #base0
    set-window-option -g window-status-bg colour0
    #set-window-option -g window-status-attr dim
    set-window-option -g window-status-current-fg red #orange
    set-window-option -g window-status-current-bg colour235
    set-window-option -g window-status-current-attr bright
    # show session name, window & pane number, date and time on right side of
    # status bar
    #set -g status-right-length 60
    #set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::"
    Anyone with a solution ?
    Thanks !
    Last edited by Kolibry (2014-10-19 20:56:04)

    I restarted the server. I also tried to skip "set -sg escape-time 1". My current shell is bash, and I can't tell you what progress I've made because I haven't made any
    EDIT : I didn't understand "rc files", I just get it now. Here is my bashrc :
    export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
    export EDITOR=vim
    export LIBVA_DRIVER_NAME=vdpau
    export VDPAU_DRIVER=r600
    export PATH=$PATH:/home/kolibry/Scripts
    source tmux-completion.sh
    source tmux-bash-completion.sh
    ansiblocks
    bind 'set completion-ignore-case on'
    if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
    fi
    xhost +local:root > /dev/null 2>&1
    complete -cf sudo
    shopt -s cdspell
    shopt -s checkwinsize
    shopt -s cmdhist
    shopt -s dotglob
    shopt -s expand_aliases
    shopt -s extglob
    shopt -s histappend
    shopt -s hostcomplete
    shopt -s nocaseglob
    export HISTSIZE=10000
    export HISTFILESIZE=${HISTSIZE}
    export HISTCONTROL=ignoreboth
    alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    alias grep='grep --color=tty -d skip'
    alias cp="cp -i" # confirm before overwriting something
    alias df='df -h' # human-readable sizes
    alias free='free -m' # show sizes in MB
    alias np='vim PKGBUILD'
    alias starwars="telnet towel.blinkenlights.nl"
    alias inxi="inxi -Fxzc2"
    alias weechat="weechat-curses"
    alias news='newsbeuter'
    alias zik="mpd && ncmpcpp"
    alias version="lsb_release -si -sr -sc"
    alias fdisk="sudo fdisk -l"
    alias formater="sudo mkfs.vfat -F 32"
    ### Dropbox ###
    #alias ./dropbox_uploader.sh upload="upload dropbox"
    #alias ./dropbox_uploader.sh download="download dropbox"
    conf() {
    case $1 in
    bspwm) vim ~/.config/bspwm/bspwmrc ;;
    sxhkd) vim ~/.config/sxhkd/sxhkdrc ;;
    conky) vim ~/.conkyrc ;;
    menu) vim ~/.config/openbox/menu.xml ;;
    mpd) vim ~/.mpd/mpd.conf ;;
    mutt) vim ~/.mutt/muttrc ;;
    ncmpcpp) vim ~/.ncmpcpp/config ;;
    moc) sudo vim /home/kolibry/.moc/config ;;
    moctheme) sudo vim /home/kolibry/.moc/themes/kolibry_theme ;;
    weechat) vim ~/.weechat/weechat.conf ;;
    pacman) sudo vim /etc/pacman.conf ;;
    mirrorlist) vim /etc/pacman/mirrorlist ;;
    termite) vim ~/.config/termite/config ;;
    ranger) vim ~/.config/ranger/rc.conf ;;
    rifle) vim ~/.config/ranger/rifle.conf ;;
    tmux) vim ~/.tmux.conf ;;
    vim) vim ~/.vimrc ;;
    compton) vim ~/.config/compton.conf ;;
    xinit) vim ~/.xinitrc ;;
    xresources) vim ~/.Xresources && xrdb ~/.Xresources ;;
    zathura) vim ~/.config/zathura/zathurarc ;;
    tint2) vim ~/.config/tint2/tint2rc ;;
    bashrc) vim ~/.bashrc && source ~/.bashrc ;;
    dwb) vim ~/.config/dwb/default/quickmarks ;;
    grub) sudo vim /etc/default/grub.cfg ;;
    mupen64plus) vim ~/.config/mupen64plus/mupen64plus.cfg ;;
    dunst) vim ~/.config/dunst/dunstrc ;;
    *) echo "Unknown application: $1" ;;
    esac
    function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
    function cdl () { cd "$@" && ls; }
    alias dpi="xdpyinfo | grep resolution"
    alias mocp="mocp -T kolibry_theme"
    ### Gestion du système ###
    # Créer une liste des paquets installés :
    alias pkglist='comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist'
    # Créer une liste des paquets AUR installés :
    alias pkglist-aur='pacman -Qqm > pkglist-aur'
    # Restaurer la liste des paquets :
    alias installpkglist='yaourt -S $(< pkglist)'
    # Mise à jour des miroirs et mettre à jour le système :
    alias update='sudo pacman-mirrors -g && sudo pacman -Syu'
    #Mettre à jour le système :
    alias maj='sudo pacman -Syu'
    # Installer un paquet :
    alias installer='sudo pacman -S'
    # Effacer un paquet :
    alias supprimer='sudo pacman -R'
    # Paquets orphelins :
    alias orphans='sudo pacman -Qdt'
    # Infos paquet :
    alias info='sudo pacman -Si'
    # Rafraichissement de la liste des paquets:
    alias refresh='sudo pacman -Syy'
    # cacheclean -v 2 ,deletes all but the last 2 versions of installed packages the pacman cache:
    alias c-c='sudo cacheclean -v 2'
    # yaourt -Syu by typing yaur :
    alias majaur='yaourt -Syu --aur'
    # yaourt -S by typing yS :
    alias install='yaourt -S'
    # yaourt -Rsn , which fully deletes packages - see above :
    alias remove='yaourt -Rsn'
    # Date dernière maj
    alias lastup='echo -e "\e[1;31mLast Upgraded:\e[0m " ; sort /var/log/pacman.log | tail -n 50 | grep upgraded | cut -c 1-18 | uniq -d'
    #Détails dernière maj
    alias lastupd='echo -e "\e[1;31mLast upgraded:\e[0m " ; cat /var/log/pacman.log | grep upgraded | tail -n 40'
    # Recharger URxvt config
    alias x='xrdb .Xresources'
    # Convertir vidéo youtube en fichier audio
    alias ogg='youtube-dl -x --audio-format vorbis --audio-quality 0'
    # mpv en couleurs
    alias mpv='mpv --msg-module'
    # Nettoyer le terminal
    alias c='clear'
    #Restaurer tmux
    alias res='sh /home/kolibry/Scripts/restoretmux'
    # Eteindre le PC
    alias stop='shutdown now'
    # Ecran externe
    alias externe='xrandr --output VGA-0 --mode 1600x900 --output LVDS --off'
    # Ecran interne
    alias interne='xrandr --output LVDS --mode 1366x768 --output VGA-0 --off'
    # Touchpad
    alias touchpadon='synclient TouchpadOff=0'
    alias touchpadoff='synclient TouchpadOff=1'
    # Test scroll rapidité terminal
    alias testterminal='for i in {0..9999}; do echo -n "------$i-"; done'
    ##fun&entertaining
    alias insults='wget http://www.randominsults.net -O - 2>/dev/null | grep \<strong\> | sed "s;^.*<i>\(.*\)</i>.*$;\1;";'
    alias matrix='echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r "; else v+="\e[2m $r "; fi; else v+=" "; fi; done; echo -e "$v"; v=""; done'
    alias matrix2='echo -e "\e[31m"; while $t; do for i in `seq 1 30`;do r="$[($RANDOM % 2)]";h="$[($RANDOM % 4)]";if [ $h -eq 1 ]; then v="\e[1m $r";else v="\e[2m $r";fi;v2="$v2 $v";done;echo -e $v2;v2="";done;'
    alias matrix3='COL=$(( $(tput cols) / 2 )); clear; tput setaf 2; while :; do tput cup $((RANDOM%COL)) $((RANDOM%COL)); printf "%$((RANDOM%COL))s" $((RANDOM%2)); done'
    alias matrix4='echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done'
    alias matrix5='tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=lcase,unblock | GREP_COLOR="1;32" grep --color "[^ ]"'
    alias colorrainbow='yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done'
    alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && echo Die || echo Live' # command line Russian roulette
    alias einsteiny='A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";' # numbers guessing game
    alias etchasketch='c=12322123;x=20;y=20;while read -sn1 p;do k=${c:(p-1)*2:2};let x+=$((k/10-2));let y+=$((k%10-2));echo -en \\033[$y\;"$x"HX;done' # use the 1 2 3 and 4 keys to move the cursor around the screen (It's an etch-a-sketch for your terminal!)
    alias excuses='echo `telnet bofh.jeffballard.us 666 2>/dev/null` |grep --color -o "Your excuse is:.*$"' # excuses
    alias freechess='telnet fics.freechess.org 5000' # connects to a telnet server for free internet chess
    alias funfacts='wget http://www.randomfunfacts.com -O - 2>/dev/null | grep \<strong\> | sed "s;^.*<i>\(.*\)</i>.*$;\1;";'
    alias 99bottles='x="bottles of beer";y="on the wall";for b in {99..1};do echo "$b $x $y, $b $x. Take one down pass it around, $(($b-1)) $x $y"; sleep 3;done'
    alias addictive='count="1" ; while true ; do read next ; if [[ "$next" = "$last" ]] ; then count=$(($count+1)) ; echo "$count" ; else count="1" ; echo $count ; fi ; last="$next" ; done' # simple addicting bash game
    alias busy='for i in `seq 0 100`;do timeout 6 dialog --gauge "Install..." 6 40 "$i";done' # pretend to be busy in office to enjoy a cup of coffee
    alias busy2='my_file=$(find /usr/include -type f | sort -R | head -n 1); my_len=$(wc -l $my_file | awk "{print $1}"); let "r = $RANDOM % $my_len" 2>/dev/null; vim +$r $my_file'
    alias busy3='cat /dev/urandom | hexdump -C | highlight ca fe 3d 42 e1 b3 ae f8 | perl -MTime::HiRes -pnE "Time::HiRes::usleep(rand()*1000000)"'
    ### Fonction scrot + upload ###
    imgur-upl() {
    curl -s -F image=@"$1" -F "key=1913b4ac473c692372d108209958fd15" \
    http://api.imgur.com/2/upload.xml | grep -Eo "<original>(.)*</original>" \
    | grep -Eo "http://i.imgur.com/[^<]*"
    # Back up file
    bu() {
    cp -a "$1" "$1.$(date +%d.%m.%y-%H:%M)"
    # ex - archive extractor
    # usage: ex <file>
    ex ()
    if [ -f $1 ] ; then
    case $1 in
    *.tar.bz2) tar xjf $1 ;;
    *.tar.gz) tar xzf $1 ;;
    *.bz2) bunzip2 $1 ;;
    *.rar) unrar x $1 ;;
    *.gz) gunzip $1 ;;
    *.tar) tar xf $1 ;;
    *.tbz2) tar xjf $1 ;;
    *.tgz) tar xzf $1 ;;
    *.zip) unzip $1 ;;
    *.Z) uncompress $1;;
    *.7z) 7z x $1 ;;
    *) echo "'$1' cannot be extracted via ex()" ;;
    esac
    else
    echo "'$1' is not a valid file"
    fi
    ##### Couleurs prompt ####
    #Black \e[0;30m
    #Blue \e[0;34m
    #Green \e[0;32m
    #Cyan \e[0;36m
    #Red \e[0;31m
    #Purple \e[0;35m
    #Brown \e[0;33m
    #Gray \e[0;37m
    #Dark Gray \e[1;30m
    #Light Blue \e[1;34m
    #Light Green \e[1;32m
    #Light Cyan \e[1;36m
    #Light Red \e[1;31m
    #Light Purple \e[1;35m
    #Yellow \e[1;33m
    #White \e[1;37m
    #NC='\e[0m' # No Color
    # background colors
    #RED='\e[41m'
    #BLUE='\e[44m'
    #CYAN='\e[46m'
    #GREEN='\e[42m'
    #YELLOW='\e[43m'
    # prompt
    #PS1="\[\e[0;33m\]┌─[\[\e[1;31m\u\e[0;33m\]]──[\[\e[0;34m\]${HOSTNAME%%.*}\[\e[0;33m\]]\[\e[0;32m\]:\w$\[\e[0;33m\]\n\[\e[0;33m\]└──\[\e[0;33m\]>>\[\e[0m\]"
    #prompt essai
    PS1="\[\e[0;34m\]┌─[\[\e[0;31mo_o\e[0;34m\]]──[\[\e[0;33m\]\w\[\e[0;34m\]]\[\e[0;34m\]\n\[\e[0;34m\]└──\[\e[0;34m\][\[\e[0m\]"
    # prompt robot
    #PS1='┌─[\e[0;31mo_o\e[m] ─ [\e[0;36m\w\e[m]\n└─|'
    BROWSER=/usr/bin/xdg-open
    ### Man pages en couleur ###
    man() {
    env LESS_TERMCAP_mb=$(printf "\e[1;31m") \
    LESS_TERMCAP_md=$(printf "\e[1;31m") \
    LESS_TERMCAP_me=$(printf "\e[0m") \
    LESS_TERMCAP_se=$(printf "\e[0m") \
    LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
    LESS_TERMCAP_ue=$(printf "\e[0m") \
    LESS_TERMCAP_us=$(printf "\e[1;32m") \
    man "$@"
    Last edited by Kolibry (2014-10-19 20:40:15)

Maybe you are looking for