Can we change the Super class attribute scope in Sub class

Hi.
I created a super class. In that i have 4 attributes. That attributes are PUBLIC.
I created a sub class. In that i got all super class attributes. I want to change that attributes as a Private. Is it possible.
If it is possible.Give me an Example with code or Pseudo code.
Regards.
Krishna.

Hi Krishna,
It is not possible... If you declare the Attributes again in Subclass of the same name as that of Super class
then the way of accessing them would be different from that of attributes in the main class.
Hope this would help you
Good luck
Narin

Similar Messages

  • Can defualt inherited the Super Class constructor to sub class ?

    Hi,
    is it passible to inherit the super class constructor by defualt when extends the super class.
    Thanks
    MerlinRoshina

    Constructor rules:
    1) Every class has at least one ctor.
    1.1) If you do not define an explicit constructor for your class, the compiler provides a implicit constructor that takes no args and simply calls super().
    1.2) If you do define one or more explicit constructors, regardless of whether they take args, then the compiler no longer provides the implicit no-arg ctor. In this case, you must explicitly define a public MyClass() {...} if you want one.
    1.3) Constructors are not inherited.
    2) The first statement in the body of any ctor is either a call to a superclass ctor super(...) or a call to another ctor of this class this(...) 2.1) If you do not explicitly put a call to super(...) or this(...) as the first statement in a ctor that you define, then the compiler implicitly inserts a call to super's no-arg ctor super() as the first call. The implicitly called ctor is always super's no-arg ctor, regardless of whether the currently running ctor takes args.
    2.2) There is always exactly one call to either super(...) or this(...) in each constructor, and it is always the first call. You can't put in more than one, and if you put one in, the compiler's implicitly provided one is removed.

  • Changing the Application class of script

    How can i change the application class of a script?

    Hi use TDOCLASS: object class.
    Hope this solves your issue.
    <REMOVED BY MODERATOR>
    Thanks,
    Dishant
    Edited by: Alvaro Tejada Galindo on Feb 6, 2008 2:33 PM

  • How can i change the class in the Class Library project to be static or public so i can use it from the windows application project ?

    First i know that when i make any changes to the class library project i need to rebuild the project then to remove the Capture.dll from the TestScreenshot project and then to add again the updated Capture.dll
    The problem for example in this case i'm trying to use a public static variable i add in the DXHookD3D9.
    In the DXHookD3D9 i added this public static variable:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    //using SlimDX.Direct3D9;
    using EasyHook;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.Threading;
    using System.Drawing;
    using Capture.Interface;
    using SharpDX.Direct3D9;
    namespace Capture.Hook
    internal class DXHookD3D9: BaseDXHook
    public DXHookD3D9(CaptureInterface ssInterface)
    : base(ssInterface)
    LocalHook Direct3DDevice_EndSceneHook = null;
    LocalHook Direct3DDevice_ResetHook = null;
    LocalHook Direct3DDevice_PresentHook = null;
    LocalHook Direct3DDeviceEx_PresentExHook = null;
    object _lockRenderTarget = new object();
    Surface _renderTarget;
    public static decimal framesperhourtodisplay = 0;
    protected override string HookName
    get
    return "DXHookD3D9";
    List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>(
    framesperhourtodisplay
    The problem is i can't even get to the Capture.Hook namespace and not to the DXHookD3D9 from the TestScreenshot application window project.
    This is a screenshot:
    For example fro the FramesPerSecond class i can use it get to it from the windows forms application.
    namespace Capture.Hook
    /// <summary>
    /// Used to determine the FPS
    /// </summary>
    public class FramesPerSecond
    int _frames = 0;
    int _lastTickCount = 0;
    float _lastFrameRate = 0;
    Since it's public i guess.
    But if i will change the DXHookD3D9 class from internal to public:
    public class DXHookD3D9: BaseDXHook
    I will get error on the DXHookD3D9: 
    Error 1
    Inconsistent accessibility: base class 'Capture.Hook.BaseDXHook' is less accessible than class 'Capture.Hook.DXHookD3D9'
    And the BaseDXHook class:
    namespace Capture.Hook
    internal abstract class BaseDXHook: IDXHook
    protected readonly ClientCaptureInterfaceEventProxy InterfaceEventProxy = new ClientCaptureInterfaceEventProxy();
    public BaseDXHook(CaptureInterface ssInterface)
    this.Interface = ssInterface;
    this.Timer = new Stopwatch();
    this.Timer.Start();
    this.FPS = new FramesPerSecond();
    Interface.ScreenshotRequested += InterfaceEventProxy.ScreenshotRequestedProxyHandler;
    Interface.DisplayText += InterfaceEventProxy.DisplayTextProxyHandler;
    InterfaceEventProxy.ScreenshotRequested += new ScreenshotRequestedEvent(InterfaceEventProxy_ScreenshotRequested);
    InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
    ~BaseDXHook()
    Dispose(false);
    How can i solve it so i can use the variable framesperhourtodisplay in the DXHookD3D9 class with the TestScreenshot windows forms application ?

    Hi,
    I dont know if it will work here, since I dont know the complete structure, but the base call must be public, if the derived class is public, so the base class is at least as accessible as the derived class.
    Try make the base class public. (And maybe the base-class IDXHook of the base also...)
    Or use a different approach and make only the properties public that are needed to be public by adding an extra class...
    A structure could look like:(you need to create a class thats public in your dll and expose a property, and set this property in the internal class...)
    In the Accessing class (here Form1)
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    C c = new C();
    MessageBox.Show(B.F.ToString());
    and in the class Lib:
    internal class A
    public A()
    B.F = DateTime.Now.Millisecond;
    public class B
    public static int F { get; set; }
    public class C
    public C()
    A a = new A();
    (add a referenc to the class lib from the accessing project)
    Regards,
      Thorsten

  • Weird one..  i can't return a variable from the extended to the super class

    Hey everyone, i hope i'm not annoying you guys :)
    So today's problem is to return a variable (int) from a method of the extended class and print it ont the super class.
    I'm just testing the super class , if it works fine.
    So the extended class ( FileIO) just read the file txt and return the integer or string ( from the txt file)
    I already did a main method to that class and tested it, it works fine.
    So now the problem is to print the integer ( that the extended class gets from the txt. ) inside the Super class. I mean , is the same thing but now im testing the Super class , just have to do the same thing, a super class method calls the extended class method and receive the integer from the txt file.
    i think the problem is when i create the instance of the FileIO object , maybe its constructor ...i don't know.
    The name of the txt file is passed from the super class to the extended class, but i think the error is not from there.
    this.aero_le = new BufferedReader(new FileReader(super.ficheiroleitura_aero()));  //  super calls ficheiroleitura_aero()  and receive the name of the txt file ( e.g "temp.txt")  so i think that is correct.
    here's the code of the Super class public class Aeroporto {
         private String filereader_voo = "temporary.txt";
         private String filereader_aero = "temp.txt";
         private String siglaAero = "";
         public FileIO file;
         public Aeroporto(){};
         public Aeroporto(String filereader_voo, String filereader_aero) throws IOException{
              this.filereader_voo = filereader_voo;
              this.filereader_aero =filereader_aero;     
              file = new FileIO();
         public String siglaAero() {
              return siglaAero; }
         public String filereader_aero(){
              return filereader_aero;
    public int nrLines() throws IOException{   // it was supose to retunr the number of lines ( integer) from the txt file .
              return Integer.parseInt(file.lerLinhaN(1,1));
    // main() {
    Aeroporto a = new Aeroporto();
              int v = a.nrLines();
              System.out.print(v);
    // ***********************************************************+
    // Extended Class
    public class FileIO extends Aeroporto{
         private String ficheiroescrita;
         private PrintWriter vooescreve, aeroescreve ;
         private BufferedReader voo_le, aero_read;
         public FileIO(){}
         public FileIO(String filereader_voo, String filereader_aero, String ficheiroescrita) throws IOException {
              super(filereader_voo, filereader_aero);
              this.ficheiroescrita = ficheiroescrita;
              //If file does not exists , create one.
              try{
                   this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
                   aero_read.close();
              catch(IOException ex){
                   this.aeroescreve = new PrintWriter(new FileWriter(ficheiroescrita));
                   aeroescreve.close();
    public String lerLinhaN(int line, int column) throws IOException{  // this method works fine , i already tested this class.
              this.aero_read = new BufferedReader(new FileReader(super.filereader_aero()));
              for(int i = 0; i != line-1; ++i) aero_read.readLine();
              String linha = aero_read.readLine();
              String [] words = linha.split(" ");
              return words[column-1];
    Maybe the error is that i use to test the Super class a default contructor on both classes... i don't know where the error is, i also did two small classes ( super and another that extends ) and get the string "Hello" from the super and print it inside the extended..and it works, that's why i think the error is when i call the extended class .. need help.
    thanks.

    Ok,
    This one might actually work... atleast it compiles.import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.File;
    import java.io.PrintWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public abstract class FileIO {
         public static boolean CreateOutputFileIfNotExists(
              String outputFilename //the name of the file to ensure exists.
         ) throws IOException
              final String functionName = "FileIO.CreateOutputFileIfNotExists";
              boolean retVal = false;
              //If the output file does does not exist then create it.
              //post condition: output file exists or an IOException has been thrown.
              BufferedReader infile = null;
              try{
                   infile = new BufferedReader(new FileReader(outputFilename));
                   retVal = true;
              } catch(IOException ex) {
                   PrintWriter outfile = null;
                   try {
                        outfile = new PrintWriter(new FileWriter(outputFilename));
                        retVal = true;
                   } catch(IOException ex2){
                        throw new IOException(functionName + ": cannot create output file " + outputFilename, ex2);
                   } finally {
                        outfile.close();
                        if (outfile.checkError()) {
                             throw new IOException(functionName + ": error on output stream " + outputFilename);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close output file " + outputFilename, ex);
              return(retVal);
         public static String readLine(
                   String  inputFilename //the name of the file to read.
              , int     lineNumber    //1 based number of the line to read from.
         ) throws IOException
              final String functionName = "FileIO.readLine";
              String outputLine = null;
              // reads the numbered "lineNumber" from "inputFilename".
              BufferedReader infile = null;
              try {
                   infile = new BufferedReader(new FileReader(new File(inputFilename)));
                   for(int i=1; i<lineNumber; ++i) infile.readLine();
                   outputLine = infile.readLine();
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              } finally {
                   try {
                        infile.close();
                   } catch(IOException ex){
                        throw new IOException(functionName + ": cannot close input file " + inputFilename, ex);
              return(outputLine);
         public static String readWord(
                   String inputFilename  //the name of the file to read.
              , int lineNumber        //1 based number of the line to read from.
              , int wordNumber        //0 based number of the word to read.
         ) throws IOException
              final String functionName = "FileIO.readWord";
              String outputWord = null;
              // reads the numbered space-seperated "wordNumber" from the numbered "lineNumber" of "inputFilename"
              try {
                   String[] words = FileIO.readLine(inputFilename, lineNumber).split(" ");
                   if (wordNumber>0 && wordNumber<words.length) outputWord = words[wordNumber-1];
              } catch(IOException ex){
                   throw new IOException(functionName + ": cannot read input file " + inputFilename, ex);
              return(outputWord);
    }Design notes... FileIO is a generic helper class... there is nothing specific to Airports, flights, or any other "domain" specific stuff in it... so it's re-usable... you can keep it and reuse it on other projects, or even share it with your friends.
    So... The airport class will just call the static methods on FileIO like this    ....
        int lineNumber=1;
        int wordNumber=1;
        String airportCode = FileIO.readWord(airportsFilename, lineNumber, wordNumber);
        ....How's that?
    corlettk: my now mandatory edit.

  • Can not change the control level of item attribute "Inventory Asset Value"

    I can not change the control level of the item attribute "Inventory Asset Value" from Master Level to Org Level. It's show me the message "FRM-40200: Field is protected against update".
    Version is below:
    Oracle Application: 10.7SC
    Form: INVIDCTL 6.0.26

    I did a trace when I chage the control level. the SQL is below:
    SELECT COUNT(*)
    FROM CST_ITEM_COSTS CHILD
    , CST_ITEM_COSTS MASTER
    WHERE MASTER.INVENTORY_ITEM_ID = CHILD.INVENTORY_ITEM_ID (+)
    AND MASTER.COST_TYPE_ID = 1
    AND CHILD.COST_TYPE_ID (+) = 1
    AND NVL(MASTER.ITEM_COST,0) != NVL(CHILD.ITEM_COST (+) ,DECODE(MASTER.ITEM_COST, NULL ,0,-99999))
    AND MASTER.ORGANIZATION_ID IN (SELECT MASTER_ORGANIZATION_ID
    FROM MTL_PARAMETERS
    WHERE ORGANIZATION_ID != MASTER_ORGANIZATION_ID )
    AND CHILD.ORGANIZATION_ID IN (SELECT ORGANIZATION_ID
    FROM MTL_PARAMETERS
    WHERE MASTER_ORGANIZATION_ID = MASTER.ORGANIZATION_ID )

  • Can we change the View attribute of the Switcher through PERSONALISE PAGE?

    Can we change the View attribute of the Switcher through PERSONALISE PAGE? I want this switcher to display another column. This switcher that i want to change is a seeded one. I have extended a VO and added a new attribute. I want this Switcher to display this new attribute. How can I acheive this.
    Regards
    Ali

    When I do exactly that I get a .XLS file that when you open it and click Save As comes up in Single Web Page mode. When I change the type I get a much smaller file. I am doing exactly what you describe, but with different results. Is it possible that this is configurable?
    Here is a screenshot of me exporting:
    http://i879.photobucket.com/albums/ab359/jameyweare/problem1.gif
    Here is the properties of the file. As you can see the size is 215kb This is actually a very small query for for demonstration purposes. I have queries that return 20k rows with 10 to 15 columns. This creates a spreadsheet that is over 20MB.
    http://i879.photobucket.com/albums/ab359/jameyweare/problem2.gif
    This next screenshot is of the Save As dialog from Excel. I have highlighted the file type that the file is currently saved in.
    http://i879.photobucket.com/albums/ab359/jameyweare/problem3.gif
    In this screenshot I have changed the file format.
    http://i879.photobucket.com/albums/ab359/jameyweare/problem4.gif
    Here is the new properties. The file size has decreased to 57.5kb. In the cases where I had files that were 20MB or greater (and took aver 10 minutes to open up), this process reduced those files to about 200kb.
    http://i879.photobucket.com/albums/ab359/jameyweare/problem5.gif
    Any help on this would be appreciated.
    Edited by: Jaime Weare on Jul 17, 2009 3:38 PM

  • Can we change the attribute once the cube is live

    Hi:
    i was wondering whether can we change the attributes once the cube is live?
    kedar

    If the Cube is LIVE with data ,we can turn ONN the NAV attribute for the cube as per the post above.
    1)Do i need to delete and reload data in the cube for the navigational attribute changed inthe cube??history data
    2)Will my deltas be affected which are live and running??
    3)will update rules deactivated be a problem when we transport to production??
    4)If we make changes to existing data model like adding infoobjects and want to have history data modified to that object ,than Can FULL REPAIR load work ??
    or making a copy of the cube ,generating export DS..loading ..the olad traditional way is the option

  • How can I change the style of a row in tableview?

    Hi,
    How can I change the style of a row in tableview, for example ,I have 10 items in table view, and I'd like to change row 1,4,10 background-color:red; font-family:Arial ,Font-Weight:BOLD.
    Any suggestion?

    Yes, I knew how can I change the style using cell factory. there is a lot of work to do if it has so many columns in table view. we need to implement every cell factory, Do we have a simple way to change the whole row style , just like fabsav said, I 'd like to set the special row like this line:
    tableview.getItems().get(i).setStyle("myRowstyle"); And I found a bug if I implement my functionality with cell factory way, I can't change the cell style after rendering cell.
    protected void updateItem(Object object, boolean empty) {
          super.updateItem(object, empty);
    }updateItem() was only triggered while cell is being rendering, there is no way if I'd like to change the cell style after rendering event.
    Hi fabsav, How can I apply a CSS class to a specific row? Can you please provide a short example?
    Edited by: imtoocute on Aug 28, 2012 10:31 AM

  • Can we change the property of each element of an array using property node or by other methods?

    Hello all,
    Can we change the property of the elements of an array. For example:
    I have an array of combo-boxes. Can i have such a scenario that different combo-boxes of the array will have different items to select an item.
    I am able to set the different "values" in different combo-boxes bu using "to be more specific class" property node.
    But i could not set the different item list in different combo-boxes.
    Please give me the solution.

    Thanks a million dave!!!!!
    I have learnt a very new and innovative thing...
    I just wanna ask you one more question in the above context.
    Can i have listbox or combo-box in a table just like in an excel sheet where we can have listbox by using "data validation" property for different cells having different list.Can i have this in labview. Because for this i have to super-impose the combo-boxes on the table and treat them separately.
    We have to take those combo-box values and put in table and then store it.I have attached one VI to show the scenario.
    And this is the alternative solution of the array problem which u have already given. So please suggest me between the two or any alternative solution.
    Thanks,
    Ankit Madaan
    Attachments:
    Recording _Table.vi ‏19 KB

  • How can I change the thickness of the cell border of a table in Pages for iPad ?

    Hi,
    i want to change the thickness of cell borders in tables in Pages for iPad to at least 2pt, better 3pt.
    How can I change the thickness in the iOS Version of Pages ?
    Thanks

    try this ...
    In ur table call this
    ColorRenderer cell=new ColorRender();
    // for(int i=0;i<table.getModel().getColumnCount();i++){
    // TableColumn mod=this.getColumn((this.getModel().getColumnName(i)));
    mod.setCellRenderer(cell);
    And ur ColorRender calss should override DefaultTableCellRenderer like this
    class ColorRenderer extends DefaultTableCellRenderer {
    protected int align;
    public ColorRenderer(int align) {
    this.align=align;
    public Component getTableCellRendererComponent(JTable table,
    Object value, boolean isSelected, boolean hasFocus, int row,
    int column) {
    setHorizontalAlignment(align);
    super.getTableCellRendererComponent(table, value, isSelected,
    hasFocus, row, column);
    if(col==4){
    setBackground(Color.cyan);
    return this;

  • How can i change the particular node color in Jtree?

    I have constructed the tree.i dont know how to set the color for the particular node then how can i change the particular node icon depends on some conditions like if we will give the input whether it is available in jtree that node icon only changed.Anyone please help me as soon as possible.

    hi,
    i saw that tutorial.from that book i dont get the particular node cell renderer.i got a cell renderer for tree only.i attached my code in this mail.pls see and help me if u will do
    mport pack.Prop;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.Font;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Properties;
    import java.util.Set;
    import java.util.StringTokenizer;
    import java.util.Vector;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.UIManager;
    import javax.swing.text.Position;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.MutableTreeNode;
    import javax.swing.tree.TreeCellRenderer;
    import javax.swing.tree.TreePath;
    public class ReadProperty3 extends JFrame{
    String str,key;
    static JTree tree;
    static Vector v;
    StringTokenizer st;
    static DefaultMutableTreeNode root;
    DefaultMutableTreeNode t;     
    public Object[] o;
    public static void main(String[] args) throws IOException {
    ReadProperty3 r = new ReadProperty3();
    Prop p=new Prop();
    JFrame f=new JFrame();
    p.show();
    Object[] o=v.toArray();
    int startRow = 0;
    String prefix =p.s;
    TreePath path = tree.getNextMatch(prefix, startRow, Position.Bias.Forward);
    //if(prefix.equals(root.getChildAt(0).toString()))
    if(prefix.equals("2000"))
         System.out.println("Node 2000 found");
         else if(prefix.equals("3000"))
              System.out.println("Node 3000 found");
         else if(prefix.equals("4000"))
              System.out.println("Node 4000 found");
         else
              System.out.println("Node not found");
         for(int i=0;i<v.size();i++)
              //((DefaultTreeModel)tree.getModel()).reload();
              DefaultTreeCellRenderer ren=(DefaultTreeCellRenderer)tree.getCellRenderer();
              Icon openIcon = new ImageIcon("C:/apache-tomcat-5.5.12/webapps/jsp-examples/images/execute.gif");
              Icon closedIcon = new ImageIcon("C:/apache-tomcat-5.5.12/webapps/jsp-examples/images/execute.gif");
              Icon leafIcon = new ImageIcon("C:/apache-tomcat-5.5.12/webapps/jsp-examples/images/read.gif");
              if(o[0].equals(p.s))
                   ren.setBackgroundSelectionColor(Color.MAGENTA);
                   ren.setBackgroundNonSelectionColor(Color.YELLOW);
                   //ren.setTextSelectionColor(Color.YELLOW);
                   //ren.setTextNonSelectionColor(Color.BLUE);
                   ren.setClosedIcon(closedIcon);
                   ren.setFont(new Font("Impact",Font.ITALIC,14));
              else if(o[1].equals(p.s))
                   ren.setLeafIcon(leafIcon);
                   ren.setFont(new Font("Impact",Font.ITALIC,10));
                   UIManager.put("Tree.leafIcon", leafIcon);
              else if(o[2].equals(p.s))
                   ren.setOpenIcon(openIcon);
                   ren.setFont(new Font("Dialog",Font.BOLD,9));
    public ReadProperty3(){
         super("JTree With Properties");
         try{
    int c = 0;
    while(c == 0){
    c = 1;
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("Enter file name which has properties extension :");
    str = bf.readLine();
    File f = new File(str + ".properties");
    if(f.exists()){
    Properties pro = new Properties();
    FileInputStream in = new FileInputStream(f);
    pro.load(in);
    System.out.println("Key: " + pro.keySet());
    System.out.print("Enter Key : ");
    key = bf.readLine();
    String p = pro.getProperty(key);
    st = new StringTokenizer(p,"=,");
    root=new DefaultMutableTreeNode(key);
    v=new Vector();
    while(st.hasMoreTokens())
         String val=st.nextToken();
         v.add(val);
         o=v.toArray();
         System.out.println(val);
         t=new DefaultMutableTreeNode(val);
         root.add(t);
         tree=new JTree(root);
         tree.setEditable(true);
         JScrollPane jp=new JScrollPane(tree);
         // tree.setCellRenderer(new CellRenderer());
         Container content=getContentPane();
         content.add(jp,BorderLayout.CENTER);
    setSize(250,275);
    setVisible(true);
    addWindowListener(new ExitListener());
    else{
    c = 0;
    System.out.println("File not found!");
    catch(IOException e){
    System.out.println(e.getMessage());
    }

  • How can I change the color of the font with the Property Inspector?

    In Dreamweaver CS6, can one change the font color with the property inspector?  How?
    I don't know if I will automatically be notified when someone responds, and I don't want to be running back to this site every day to check.  So if you have an answer for me, would you be kind enough to email me at [email protected]?  Many thanks.

    mike agranoff wrote:
    A font color button was available in a previous version of Dreamweaver I had been using.  But that version was incompatible with Windows 7, which is what my newer machine uses. 
    "Upgrade" and "improvement" are rarely synonymous.
    Mike Agranoff
    There is still a font color button in DW. In the Properties window, click the CSS button in the lower left when you have text selected. There is a little gray square with a tiny black arrow in the corner for font colors. It still uses css, but will muddy up your text with inline styles which isn't generally the best way to do things.
    One of the biggest advantages to using css is the ability to put all of your styles in one external .css file. That allows you to make a single change, to a color setting for instance, and have that change affect your entire site (everything you put a given css class on). As it stands, using the old html font-color attribute, or inline css forces you to go through the code with a fine tooth comb and change each individual setting.
    CSS is a massive upgrade and improvement over the old method.
    I would definitely suggest getting familiar with css, it really is required for any kind of modern website and ends up making your life much much easier while using the CSS Designer window in DW (which is where a lot of this stuff takes place now in a Design View development approach)...
    http://w3schools.com/css is a good place to start.

  • How can I change the palette of a BufferedImage

    How can I change the palette of a BufferedImage ?
    My image uses an IndexColorModel but I want to use a web safe palette.
    I can't see a way to make a setColorModel() to my image.
    Any ideas ?
    Thanks...

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class ICMExample extends JComponent {
        private BufferedImage original, copy;
        private Point mouseLocation = new Point();
        public ICMExample(BufferedImage original, BufferedImage copy) {
            this.original = original;
            this.copy = copy;
            addMouseMotionListener(new MouseMotionAdapter(){
                public void mouseDragged(MouseEvent e) {
                    mouseLocation = e.getPoint();
                    repaint();
        public Dimension getPreferredSize() {
            return new Dimension(original.getWidth(), original.getHeight());
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            g2.drawRenderedImage(original, null);
            Shape oldClip = g2.getClip();
            g2.clipRect(0, 0, mouseLocation.x, Integer.MAX_VALUE);
            g2.drawRenderedImage(copy, null);
            g2.setClip(oldClip);
        public static void main(String[] args) throws IOException {
            URL url = new URL("http://weblogs.java.net/jag/Image54-large.jpeg");
            BufferedImage original = ImageIO.read(url);
            JComponent app = new ICMExample(original, makeICMVersion(original));
            final JFrame f = new JFrame("Drag mouse over image");
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.getContentPane().add(app);
                f.pack();
                SwingUtilities.invokeLater(new Runnable(){
                    public void run() {
                        f.setLocationRelativeTo(null);
                        f.setVisible(true);
        static BufferedImage makeICMVersion(BufferedImage original) {
            int w = original.getWidth();
            int h = original.getHeight();
            IndexColorModel icm = createICM();
            BufferedImage copy = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_INDEXED, icm);
            Graphics2D g = copy.createGraphics();
            g.drawRenderedImage(original, null);
            g.dispose();
            return copy;
        static IndexColorModel createICM() {
            byte MAX = (byte) 255;
            byte[] r = {MAX, MAX, MAX, MAX, 0, 0, 0, 0};
            byte[] g = {MAX, MAX, 0, 0, MAX, MAX, 0, 0};
            byte[] b = {MAX, 0, MAX, 0, MAX, 0, MAX, 0};
            return new IndexColorModel(3, 8, r, g, b);
    }

  • How can i change the default text "Query by Example"

    Studio Edition Version 11.1.1.3.0
    how can i change the default text *"Query by Example"* in a Panel Collection
    Thx

    Hi thieto,
    The label you are looking for is af_panelCollection.LABEL_MENUITEM_QBE*
    I'm currently writing a blogpost on this issue. In short, you will have to create a skin resource bundle.
    In the skin definition, refer to this bundle class.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <skins xmlns="http://myfaces.apache.org/trinidad/skin">
      <skin>
        <id>mySkin.desktop</id>
        <family>MySkin</family>
        <extends>blafplus-rich.desktop</extends>
        <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
        <style-sheet-name>skins/MySkin.css</style-sheet-name>
        <bundle-name>com.blogspot.lucbors.view.bundles.MySkinBundle </bundle-name>
      </skin>
    </skins>In this class, adjust the label text to your needs.
    package com.blogspot.lucbors.view.bundles;
    import java.util.ListResourceBundle;
    public class MySkinBundle extends ListResourceBundle {
      public MySkinBundle() {
        super();
    @Override
      public Object[][] getContents() {
        return _CONTENTS;
    static private final Object[][] _CONTENTS = {
         {"af_panelCollection.LABEL_MENUITEM_QBE","the text that you want"}
    }More in the blogpost
    Good luck
    Luc Bors
    Edited by: lucbors on Jul 26, 2010 11:39 AM (blogpost finished - URL added)

Maybe you are looking for

  • Spry menu rendering errors

    Hi, I created a spry horizontal menu bar in Dreamweaver.  It renders correctly in Dreamweaver designer but not in Firefox or Internet explorer. Below are three pictures.  The menu is the blue line above the title "Cliff Steele". The Firefox displays

  • Is it possible to hide part of the line in webI line chart

    I had webI line chart which is showing for 2 months data, and is it possible to hide the line for only first 10 days in the line chart and continue the line after 11 th day till the end?

  • Cover Flow in phone application

    I am probably not the first one to think about this feature suggestion but nonetheless. Wouldn't it be cool if the phonebook would act the same way as the iPod does? i.e. scroll through names in vertical mode and scroll through contact pictures in ho

  • Full screen widget and footer

    Hi Guys, I want to protect my footer from my full screen widget  slide show. I could put my footer in one layer and the widget in another, unfortunately in this case the footer will hide part of my slide show. I don't like this solution.  I could cre

  • Error installing PS CS4 "HierarchyRequestError"

    I am trying to install my trusted PhotoShop CS4 on a new Win7 PC. The installer fails with: "Critical errors were found in setup:HierarchyRequestError " How can I resolve this?