Applet Layout

Hi Guys i am new to applet development and I need to layout an applet with
5 labels down the left
5 labels down the right
url box at the top
button on the bottom
I have been using some tutorials and nothing is good enough, please help.

import java.awt.*;
import javax.swing.*;
public class AppletLayout extends JApplet
    public void init()
        setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.gridwidth = gbc.REMAINDER;
        add(new JTextField(16), gbc);
        for(int j = 0, k = 1; j < 5; j++)
            addLabels(getLabel(k++), getLabel(k++), gbc);
        add(new JButton("button"), gbc);
    private void addLabels(JLabel label1, JLabel label2, GridBagConstraints gbc)
        gbc.gridwidth = gbc.RELATIVE;
        add(label1, gbc);
        gbc.gridwidth = gbc.REMAINDER;
        add(label2, gbc);
    private JLabel getLabel(int n)
        JLabel label = new JLabel("label " + n, JLabel.CENTER);
        label.setBorder(BorderFactory.createEtchedBorder());
        return label;
    public static void main(String[] args)
        JApplet applet = new AppletLayout();
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.add(applet);
        f.setSize(400,400);
        f.setLocation(200,200);
        applet.init();
        f.setVisible(true);
}

Similar Messages

  • How do you draw an image into a certain field in applet layout?

    i need to to take a image drawn from a function and place it in the "center" field of a borderlayout applet...

    Check out the link shown below for a complete example on how to do this:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=226875
    V.V.

  • Applet layout problem

    Hi!
    I've got several classes that inherit from JPanel and they're added to JApplet with BorderLayout. I would like to switch the visibility of the panels, so they are added aheap. This is the code:
    tp = new TitlePanel();
            wp = new WelcomePanel();
            cp1 = new ChartsPanel1();
            cp2 = new ChartsPanel2();
            sp = new SynopticPanel();
            psvp = new PowerStationViewPanel();
            wp.setVisible(true);
            cp1.setVisible(false);
            cp2.setVisible(false);
            sp.setVisible(false);
            psvp.setVisible(false);
            containers = new Container[6];
            containers[0] = wp;
            containers[1] = sp;
            containers[2] = cp1;
            containers[3] = cp2;
            containers[4] = psvp;
            containers[5] = this;
            mp = new MenuPanel(containers);
            container = getContentPane();
            container.add(tp, PAGE_START);
            container.add(mp, LINE_START);
            container.add(wp, CENTER);
            container.add(sp, CENTER);
            container.add(cp1, CENTER);
            container.add(cp2, CENTER);
            container.add(psvp, CENTER);

    We need to choose only one thread to answer. What about [this one|http://forums.sun.com/thread.jspa?threadID=5330601&tstart=0] ?

  • Cant figure out whats wrong with my applet, help pls??

    this applet checks a string against one in a database then if passwords match, a new url is opened. the applet loads in webpage with no problems. it just doesnt seem to work. have granted full access to code base in policy file.
    heres the code:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.applet.*;
    import java.sql.*;
    import java.net.*;
    public class LoginApplet extends Applet implements ActionListener
        Panel top;
        Panel bottom;
        TextField nameField;
        TextField passField;
        Label userNameLabel;
        Label passwordLabel;
        Button loginButton;
        public void init()
            setSize(230,200);
            setBackground(Color.white);
            // Create panels, labels, and text fields
            top                = new Panel(new FlowLayout(FlowLayout.LEFT));
            bottom                = new Panel(new FlowLayout(FlowLayout.LEFT));
            nameField           = new TextField(15);
            passField           = new TextField(15);
            userNameLabel      = new Label("User Name:", Label.LEFT);
            passwordLabel      = new Label("Password:   ", Label.LEFT);
            loginButton          = new Button("Login:");
            loginButton.addActionListener(this);
            // Mask the input so that people looking over your shoulder
            // won't be able to see the password
            passField.setEchoChar('*');
            // Add items to their panels
            top.add(userNameLabel);
            top.add(nameField);
            top.add(passwordLabel);
            top.add(passField);
            bottom.add(loginButton);
            // Set the applet layout
            setLayout(new GridLayout(3,3));
            // Add the panels to the applet (skip this
            // part and you won't see the panels on screen)
            add(top);
            add(bottom);
        public void actionPerformed(ActionEvent e)
                   String name      = nameField.getText();
                   String pass      = passField.getText();
                   try
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                        // set this to a MS Access DB
                        String filename = "e:/iain/College/Y4/SWP/Program/website/database/loginDetails.mdb";
                        String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
                        database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
                        // now we can get the connection from the DriverManager
                        Connection con = DriverManager.getConnection( database ,"","");
                        Statement s = con.createStatement();
                        s.execute(" SELECT [password] FROM logindetails WHERE [username] = '" + name + "' "); // select the data from the table
                        ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query
                        if (rs != null) // if rs == null, then there is no ResultSet to view
                             while ( rs.next() ) // this will step through our data row-by-row
                                  String passtmp = "";
                                  passtmp = passtmp + rs.getString(1);
                                  if(passtmp.equals(pass))
                                       String url = "E:/iain/College/Y4/SWP/Program/website";
                                       Runtime rt = Runtime.getRuntime();
                                       String[] callAndArgs = {"\"C:\\Program Files\\Internet Explorer\\iexplore.exe\"", url };
                                       try
                                            Process child = rt.exec(callAndArgs);
                                            nameField.setText("");
                                            passField.setText("");
                                       catch (Exception eee)
                                            eee.printStackTrace(System.err);
                                  else
                                       System.out.println("Invalid Password " +name);
                                  s.close(); // close the Statement to let the database know we're done with it
                                 con.close(); // close the Connection to let the database know we're done with it
                   catch (Exception ee)
                        System.out.println("Error: " + ee);
    }

    this is the initial error, when applet is run:
    java.security.policy: error adding Entry:
    java.net.MalformedURLException: unknown
    unknown protocol: eI don't know where that's from that code, but e isn't a protocol. If it's a file, you should append "file:///" to the full path.
    then when trying to read from db:
    Error: java.security.AccessControlException: access
    denied (java.lang.RuntimePer
    mission accessClassInPackage.sun.jdbc.odbc)
    didnt think of running it through applet viewer.
    the whole thing will be running on the same server
    using IIS over a LANYou don't connect to a local file system thru an applet without a signed applet. Period.

  • Setting applet title

    how can i set the title of an applet??

    Set the applet layout to borderLayout, add a Label to "North", and a Panel to "Center".
    The Label will be the 'Title', all the other components will be added to the Panel.
    Noah

  • Panel inside an applet

    Hi,
    I have try to include a panel in applet with the code as follow:
    private LoginPanel loginPanel = null;
    public void init() {
    loginPanel = new LoginPanel();
    add(loginPanel);
    the LoginPanel class is as follow:
    import java.awt.*;
    public class LoginPanel extends Panel {
    private Button submitButton = null;
    private Button resetButton = null;
    private Label userIDLabel = null;
    private Label userPwdLabel = null;
    protected TextField userIDTextField = null;
    protected TextField userPwdTextField = null;
    public LoginPanel() {
    super();
    setFont(new Font("Serif", Font.PLAIN, 12));
    setBackground(Color.white);
    setLayout(new FlowLayout());
    userIDLabel = new Label("User ID: ");
    userIDLabel.setBackground(Color.yellow);
    userPwdLabel = new Label("User Password: ");
    userPwdLabel.setBackground(Color.yellow);
    public void paint(Graphics g) {
    Dimension d = getSize();
    Point p = getLocation();
    g.drawRect(p.x, p.y, d.width-1, d.height-1);
    However, the paint function of the LoginPanel can't draw the the rectangle. Is there any problem with the code??
    Thank you very much.

    Hi,
    Your problem relates to layoutManagers and has nothing to do with painting. By default an Applet and a Panel use FlowLayout manager. Your problem is that you don't give anything a size except for the applet. Therefore, your LoginPanel is very small. You have two choices to make it work.
    1. Use a BorderLayout for the Applet layout manager and it will make sure that your LoginApplet is the same size as the Applet.
      public void init()
        loginPanel = new LoginPanel();
        setLayout( new BorderLayout() );
        add( loginPanel );
      }2. There is no setPrefferedSize method in AWT so you will need to override the getPrefferedSize method inside your LoginPanel class to give it some size. This is because FlowLayout will call this class in order to perform its' layout.
      public Dimension getPreferredSize()
        return( new Dimension( 500, 300 ) );
      }Regards,
    Manfred.

  • Help Please I am new to programming Java1.3.1

    I am having the following problem with the appletviewer for the following code and screen print of error message. I would greatly aperciate any help i can get.Thanks Adera...
    my e-mail address is [email protected]
    Sorry the screen print will not copy into here so i will type it out.
    java.lang.ClassCastException:Calculator
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:579)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:515)
    at sun.applet.AppletPanel.run(AppletPanel.java:293)
    at java.lang.Thread.run(Thread.java:484)
    Here is my code..
    //Adera Currie Student Id# 31248
    //Course Title: Internet Programming
    //Due Date: August 13th, 2002
    //calculator.Java
    //Hilltop Library Calculator Java Project
    //import javax.swing.*;
    //import javax.swing.JOptionPane;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    //import java.awt.Container;
    public class Calculator extends JFrame implements ActionListener
    int chioce, i;
    //integer variable to hold stringnums in
    double calcone, calctwo;
    //variables for mouse clicks
    double numone, numtwo, total, holdnum, decimalCount;
    String calctot, calctot1, calctot2, negnum, holdnumonetwo;
    //declare text area
    TextField text1;
    //declare button array
    Button calcbutton[], clear;
    //string array to convert textfield values, string manipulation
    String textfield;
    String bpressedEvaluated;
    //declare panel object
    Panel bpanel,text2,Cpanel;
    //declare variable arrays to hold the name and numbers of the buttons that
    //will be created on the applet
    String bnames[] = {"7","8","9","/","Sin","4","5","6",
    "*","Cos","1","2","3","-","Tan",
    "0",".","=","+","Neg"};
    //arrays for holding the items to check for when the action click event is called
    String holdOperatorVisual[] = {"/","*","-","=","+"};
    String holdNumNames[] = {"0","1","2","3","4","5","6","7","8","9",".","Neg"};
    String holdSciFiVisuals[] = {"Sin","Cos","Tan"};
    //declare boolean values to keep track of numbers and operators either
    //in use or what should be terminated
    boolean operators,operators2;
    boolean firstnum;
    boolean secondnum;
    boolean numberpressed,decimalPressed,negPressed;
    public void init()
    //create the panels to hold applet objects
    bpanel = new Panel();
    text2 = new Panel();
    Cpanel = new Panel();
    //set up the applet layout for the buttons and such
    //BorderLayout layout = new BorderLayout(5,5);
    setLayout(new BorderLayout(5,5));
    //create a container object
    //Container c = this.getContentPane();
    //c.setLayout(new FlowLayout());
    //this.setLayout( new FlowLayout() );
    //set up the panels with layout manager
    bpanel.setLayout( new GridLayout (4,5));
    text2.setLayout(new GridLayout(1,1));
    Cpanel.setLayout(new GridLayout(1,1));
    //create my text field to hold the display for the user
    text1 = new TextField(20);
    //make it so the user cannot enter text from the keyboard
    text1.setEditable(false);
    text1.setBackground(Color.cyan);
    text2.add(text1);
    //add teh panel to the container
    add(text2, BorderLayout.NORTH);
    //instantiate button object
    calcbutton = new Button[bnames.length];
         for ( int i = 0; i < bnames.length; i++ )
    calcbutton[i] = new Button(bnames);
    calcbutton[i].addActionListener(this);
    //(new ActionListener()
         calcbutton[i].setBackground(Color.cyan);
    //add the new button from teh array into the panel for buttons
    bpanel.add(calcbutton[i]);
    //add the button panel to the container object
    add(bpanel, BorderLayout.CENTER);
    //create the clear button to be displayed at the bottom of the screen
    clear = new Button("Clear");
    //add the action listener for this object
    clear.addActionListener(this);
    clear.setBackground(Color.cyan);
    //add the clear button to the panel for the clear button
    Cpanel.add(clear);
    //add the clear button panel to the container
    add(Cpanel, BorderLayout.SOUTH);
         public void actionPerformed(ActionEvent e)
         String bpressed = (e.getActionCommand());
         checkButtonPressed(bpressed);
         if(bpressedEvaluated=="notFound")
    //JOptionPane.showMessageDialog(null, "Invalid button selection!",
    // "System Message", JOptionPane.INFORMATION_MESSAGE);
    public void checkButtonPressed(String valueIn)
              String me;
              String takeValueIn = valueIn;
              double tot=0;
              String tat;
              for (i=0;i<holdNumNames.length;i++)
         if(takeValueIn == holdNumNames[i])
         //if there is a second operator in memory, then clear the contents of the
         //text box and start over adding in new numbers from the user
         if (takeValueIn == ".")
         if (decimalPressed == true)
    //JOptionPane.showMessageDialog(null, "This function cannot be used with any other operatorsdecimalPressed== " + decimalPressed,"System Message.", JOptionPane.INFORMATION_MESSAGE);
    break;
    else
    decimalPressed = true;
    if(takeValueIn == "Neg")
         if(numberpressed == false && negPressed == false)
    negPressed = true;
    takeValueIn = "-";
    else
    break;
    if (operators2 == true)
         String nothing;
         nothing = "";
         text1.setText(nothing);
         operators2 = false;
    //if there is no data in the text box, then set this number as the new text
         if (text1.getText().length() == 0)
    text1.setText(takeValueIn);
    //if there is text contained in the text field, then append this number to
    //to the text field and set the new text view for the user
    else if (text1.getText().length() != 0)
    holdnumonetwo = text1.getText();
    holdnumonetwo += takeValueIn;
    text1.setText(holdnumonetwo);
    numberpressed = true;
    bpressedEvaluated = "Found";
    break;
    for (i=0;i<holdOperatorVisual.length;i++)
    if(takeValueIn == holdOperatorVisual[i])
    if (takeValueIn == "=")
    if (operators == true)
    //convert text to number two for calculation
    numtwo = Double.parseDouble(text1.getText());
    //do the math
    if(calctot1=="-")
    tot = numone-numtwo;
    else if(calctot1=="+")
    tot = numone+numtwo;
    else if(calctot1=="/")
    tot = numone/numtwo;
    else if(calctot1=="*")
    tot = numone*numtwo;
    //convert total to string
    tat = String.valueOf(tot);
    //set the visual value to the screen for the user
    text1.setText(tat);
    //update the new number one to be used in the next calculation
    numone = tot;
    decimalPressed = false;
    negPressed = false;
    numberpressed = false;
    break;
    else
    if (operators != true && text1.getText().length()!= 0)
    calctot1 = takeValueIn;
    numone = Double.parseDouble(text1.getText());
    String t;
    t = "";
    text1.setText(t);
    firstnum = true;
    operators = true;                                    decimalPressed = false;
    negPressed = false;                               numberpressed = false;                                    break;
    else if (operators == true && text1.getText().length()!= 0)
    {                                                                                                                                                     calctot2 = takeValueIn;                                                                                                                                                     numtwo = Double.parseDouble(text1.getText());                                                                                                                                                     //do the math                                                                                                                                                if(calctot1=="-")                                                                                                                                                       {                                                                                                                                                     tot = numone-numtwo;                                                                                                                                                    }                                    else if(calctot1=="+")                                    {                                                                                                                                                        tot = numone+numtwo;                                                                                                                                                        }                                    else if(calctot1=="/")                                    {                                                                                                                                                            tot = numone/numtwo;                                                                                                                                                            }                                    else if(calctot1=="*")                                    {                                                                                                                                                                tot = numone*numtwo;                                                                                                                                                               }                                    //convert total to string                                    tat = String.valueOf(tot);                                    //set the visual value to the screen for the user                                    text1.setText(tat);                               //update the new number one to be used in the next calculation                               numone = tot;                               operators2 = true;                               decimalPressed = false;                               negPressed = false;                               }                               calctot1 = calctot2;                               //set the flags                               firstnum = true;                               decimalPressed = false;                               negPressed = false;                               numberpressed = false;                               bpressedEvaluated = "found";                               break;                               }                          }                     }                          for(i=0;i<holdSciFiVisuals.length;i++)                     {                                                                                                                                                         if(takeValueIn == holdSciFiVisuals[i])                     {                                                                                                                                                        if (text1.getText().length()!= 0 && operators != true)                                                                                                                                                            {                                                                                                                                                               double s=0;                                                                                                                                                                numone = Double.parseDouble(text1.getText());                                                                                                                                                            if(takeValueIn == "Sin")                                                                                                                                                                 s = Math.sin(numone);                                                                                                                                                            if(takeValueIn == "Cos")                                                                                                                                                                  s = Math.cos(numone);                                                                                                                                                            if(takeValueIn == "Tan")                                                                                                                                                                  s = Math.tan(numone);                                                                                                                                                                  firstnum = true;                                                                                                                                                                  String ch;                                                                                                                                                                  ch = String.valueOf(s);                                                                                                                                                                  text1.setText(ch);                                                                                                                                                                  operators2 = true;                                                                                                                                                            }                     else if (operators == true)                     {                                                                                                                                                                 //JOptionPane.showMessageDialog(null, "This function cannot be used with any other operators",                                                                                                                                                          //"System Message", JOptionPane.INFORMATION_MESSAGE);                                                                                                                                                                     break;                                                                                                                                                               }                          bpressedEvaluated = "found";                          decimalPressed = false;                          negPressed = false;                          numberpressed = false;                     }                }                          bpressedEvaluated = "notFound";                     if(takeValueIn == "Clear")
    //reset all the values that are either presently in use, or that will be the
    //first values to be used after the text field is cleared, to start from square one
    numone = 0;
    numtwo = 0;
    //set the flags
    firstnum = false;
    secondnum = false;
    operators = false;
    operators2 = false;
    decimalPressed = false;
    negPressed = false;
    numberpressed = false;
    //declare string to help clear the text field
    String cn;
    cn = "";
    //set the text field to nothing, an empty string
    text1.setText(cn);
         //execute application
         public static void main (String args[])
         Calculator application = new Calculator();
    //     addMouseListener(this);
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Adera Currie Student Id# 31248
    //Course Title: Internet Programming
    //Due Date: August 13th, 2002
    //calculator.Java
    //Hilltop Library Calculator Java Project
    //import javax.swing.*;
    //import javax.swing.JOptionPane;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    //import java.awt.Container;
    public class Calculator extends JFrame implements ActionListener
         int chioce, i;
         //integer variable to hold stringnums in
         double calcone, calctwo;
         //variables for mouse clicks
         double numone, numtwo, total, holdnum, decimalCount;
         String calctot, calctot1, calctot2, negnum, holdnumonetwo;
         //declare text area
         TextField text1;
         //declare button array
         Button calcbutton[], clear;
         //string array to convert textfield values, string manipulation
         String textfield;
         String bpressedEvaluated;
         //declare panel object
         Panel bpanel,text2,Cpanel;
         //declare variable arrays to hold the name and numbers of the buttons that
         //will be created on the applet
         String bnames[] = {"7","8","9","/","Sin","4","5","6",
    "*","Cos","1","2","3","-","Tan",
    "0",".","=","+","Neg"};
         //arrays for holding the items to check for when the action click event is called
         String holdOperatorVisual[] = {"/","*","-","=","+"};
         String holdNumNames[] = {"0","1","2","3","4","5","6","7","8","9",".","Neg"};
         String holdSciFiVisuals[] = {"Sin","Cos","Tan"};
         //declare boolean values to keep track of numbers and operators either
         //in use or what should be terminated
         boolean operators,operators2;
         boolean firstnum;
         boolean secondnum;
         boolean numberpressed,decimalPressed,negPressed;
         public Calculator()
              //create the panels to hold applet objects
              bpanel = new Panel();
              text2 = new Panel();
              Cpanel = new Panel();
              //set up the applet layout for the buttons and such
              //BorderLayout layout = new BorderLayout(5,5);
              getContentPane().setLayout(new BorderLayout(5,5));
              //create a container object
              //Container c = this.getContentPane();
              //c.setLayout(new FlowLayout());
              //this.setLayout( new FlowLayout() );
              //set up the panels with layout manager
              bpanel.setLayout( new GridLayout (4,5));
              text2.setLayout(new GridLayout(1,1));
              Cpanel.setLayout(new GridLayout(1,1));
              //create my text field to hold the display for the user
              text1 = new TextField(20);
              //make it so the user cannot enter text from the keyboard
              text1.setEditable(false);
              text1.setBackground(Color.cyan);
              text2.add(text1);
              //add teh panel to the container
              getContentPane().add(text2, BorderLayout.NORTH);
              //instantiate button object
              calcbutton = new Button[bnames.length];
              for ( int i = 0; i < bnames.length; i++ )
                   calcbutton[0] = new Button(bnames[0]);
                   calcbutton[0].addActionListener(this);
                   //(new ActionListener()
                   calcbutton[0].setBackground(Color.cyan);
                   //add the new button from teh array into the panel for buttons
                   bpanel.add(calcbutton[0]);
              //add the button panel to the container object
              getContentPane().add(bpanel, BorderLayout.CENTER);
              //create the clear button to be displayed at the bottom of the screen
              clear = new Button("Clear");
              //add the action listener for this object
              clear.addActionListener(this);
              clear.setBackground(Color.cyan);
              //add the clear button to the panel for the clear button
              Cpanel.add(clear);
              //add the clear button panel to the container
              getContentPane().add(Cpanel, BorderLayout.SOUTH);
              pack();
              show();
         public void actionPerformed(ActionEvent e)
              String bpressed = (e.getActionCommand());
              checkButtonPressed(bpressed);
              if(bpressedEvaluated=="notFound")
                   //JOptionPane.showMessageDialog(null, "Invalid button selection!",
                   // "System Message", JOptionPane.INFORMATION_MESSAGE);
         public void checkButtonPressed(String valueIn)
              String me;
              String takeValueIn = valueIn;
              double tot=0;
              String tat;
              for (i=0;i<holdNumNames.length;i++)
                   if(holdNumNames.equals(takeValueIn + ""))
                        //if there is a second operator in memory, then clear the contents of the
                        //text box and start over adding in new numbers from the user
                        if(takeValueIn == ".")
                             if (decimalPressed == true)
                                  //JOptionPane.showMessageDialog(null, "This function cannot be used with any other operatorsdecimalPressed== " + decimalPressed,"System Message.", JOptionPane.INFORMATION_MESSAGE);
                                  break;
                             else
                                  decimalPressed = true;
                        if(takeValueIn == "Neg")
                             if(numberpressed == false && negPressed == false)
                                  negPressed = true;
                                  takeValueIn = "-";
                             else
                                  break;
                        if (operators2 == true)
                             String nothing;
                             nothing = "";
                             text1.setText(nothing);
                             operators2 = false;
                        //if there is no data in the text box, then set this number as the new text
                        if(text1.getText().length() == 0)
                             text1.setText(takeValueIn);
                        //if there is text contained in the text field, then append this number to
                        //to the text field and set the new text view for the user
                        else if (text1.getText().length() != 0)
                             holdnumonetwo = text1.getText();
                             holdnumonetwo += takeValueIn;
                             text1.setText(holdnumonetwo);
                        numberpressed = true;
                        bpressedEvaluated = "Found";
                        break;
              for (i=0;i<holdOperatorVisual.length;i++)
                   if(holdOperatorVisual.equals(takeValueIn+""))
                        if (takeValueIn == "=")
                             if (operators == true)
                                  //convert text to number two for calculation
                                  numtwo = Double.parseDouble(text1.getText());
                                  //do the math
                                  if(calctot1=="-")
                                       tot = numone-numtwo;
                                  else if(calctot1=="+")
                                       tot = numone+numtwo;
                                  else if(calctot1=="/")
                                       tot = numone/numtwo;
                                  else if(calctot1=="*")
                                       tot = numone*numtwo;
                                  //convert total to string
                                  tat = String.valueOf(tot);
                                  //set the visual value to the screen for the user
                                  text1.setText(tat);
                                  //update the new number one to be used in the next calculation
                                  numone = tot;
                                  decimalPressed = false;
                                  negPressed = false;
                                  numberpressed = false;
                             break;
                        else
                             if (operators != true && text1.getText().length()!= 0)
                                  calctot1 = takeValueIn;
                                  numone = Double.parseDouble(text1.getText());
                                  String t;
                                  t = "";
                                  text1.setText(t);
                                  firstnum = true;
                                  operators = true; decimalPressed = false;
                                  negPressed = false; numberpressed = false; break;
                             else if (operators == true && text1.getText().length()!= 0)
                             { calctot2 = takeValueIn; numtwo = Double.parseDouble(text1.getText()); //do the math if(calctot1=="-") { tot = numone-numtwo; } else if(calctot1=="+") { tot = numone+numtwo; } else if(calctot1=="/") { tot = numone/numtwo; } else if(calctot1=="*") { tot = numone*numtwo; } //convert total to string tat = String.valueOf(tot); //set the visual value to the screen for the user text1.setText(tat); //update the new number one to be used in the next calculation numone = tot; operators2 = true; decimalPressed = false; negPressed = false; } calctot1 = calctot2; //set the flags firstnum = true; decimalPressed = false; negPressed = false; numberpressed = false; bpressedEvaluated = "found"; break; } } } for(i=0;i<holdSciFiVisuals.length;i++) { if(takeValueIn == holdSciFiVisuals) { if (text1.getText().length()!= 0 && operators != true) { double s=0; numone = Double.parseDouble(text1.getText()); if(takeValueIn == "Sin") s = Math.sin(numone); if(takeValueIn == "Cos") s = Math.cos(numone); if(takeValueIn == "Tan") s = Math.tan(numone); firstnum = true; String ch; ch = String.valueOf(s); text1.setText(ch); operators2 = true; } else if (operators == true) { //JOptionPane.showMessageDialog(null, "This function cannot be used with any other operators", //"System Message", JOptionPane.INFORMATION_MESSAGE); break; } bpressedEvaluated = "found"; decimalPressed = false; negPressed = false; numberpressed = false; } } bpressedEvaluated = "notFound"; if(takeValueIn == "Clear")
                                       //reset all the values that are either presently in use, or that will be the
                                       //first values to be used after the text field is cleared, to start from square one
                                       numone = 0;
                                       numtwo = 0;
                                       //set the flags
                                       firstnum = false;
                                       secondnum = false;
                                       operators = false;
                                       operators2 = false;
                                       decimalPressed = false;
                                       negPressed = false;
                                       numberpressed = false;
                                       //declare string to help clear the text field
                                       String cn;
                                       cn = "";
                                       //set the text field to nothing, an empty string
                                       text1.setText(cn);
         //execute application
         public static void main (String args[])
              Calculator application = new Calculator();
              // addMouseListener(this);
              application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

  • Java.security.AccessControlException: access denied when loading from a jar

    Hello!
    I am trying to deploy an applet into a browser but I have encountered a security problem.
    The name of the applet is SWTInBrowser(not exactly mine, it's an example from the web).
    package my.applet;
    import org.eclipse.swt.awt.SWT_AWT;
    import java.applet.Applet;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.Canvas;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.graphics.Point;
    import org.eclipse.swt.layout.FillLayout;
    public class SWTInBrowser extends Applet implements Runnable{
         public void init () {
               /* Create Example AWT and Swing widgets */
               java.awt.Button awtButton = new java.awt.Button("AWT Button");
               add(awtButton);
               awtButton.addActionListener(new ActionListener () {
                public void actionPerformed (ActionEvent event) {
                 showStatus ("AWT Button Selected");
               javax.swing.JButton jButton = new javax.swing.JButton("Swing Button");
               add(jButton);
               jButton.addActionListener(new ActionListener () {
                public void actionPerformed (ActionEvent event) {
                 showStatus ("Swing Button Selected");
               Thread swtUIThread = new Thread (this);
               swtUIThread.start ();
              public void run() {
               /* Create an SWT Composite from an AWT canvas to be the parent of the SWT
              widgets.
                * The AWT Canvas will be layed out by the Applet layout manager.  The
              layout of the
                * SWT widgets is handled by the application (see below).
               Canvas awtParent = new Canvas();
               add(awtParent);
               Display display = new Display();
               Shell swtParent = SWT_AWT.new_Shell(display, awtParent);
    //           Display display = swtParent.getDisplay();
               swtParent.setLayout(new FillLayout());
               /* Create SWT widget */
               org.eclipse.swt.widgets.Button swtButton = new
              org.eclipse.swt.widgets.Button(swtParent, SWT.PUSH);
               swtButton.setText("SWT Button");
               swtButton.addListener(SWT.Selection, new Listener() {
                public void handleEvent(Event event){
                 showStatus("SWT Button selected.");
               swtButton.addListener(SWT.Dispose, new Listener() {
                public void handleEvent(Event event){
                 System.out.println("Button was disposed.");
               // Size AWT Panel so that it is big enough to hold the SWT widgets
               Point size = swtParent.computeSize (SWT.DEFAULT, SWT.DEFAULT);
               awtParent.setSize(size.x + 2, size.y + 2);
               // Need to invoke the AWT layout manager or AWT and Swing
               // widgets will not be visible
               validate();
               // The SWT widget(s) require an event loop
               while (!swtParent.isDisposed()) {
                if (!display.readAndDispatch()) display.sleep ();
    }It works perfectly in the Applet Viewer, but not in the browser. In the browser, I only get two buttons working, the SWT button doesn't appear, because of this error:
    Exception in thread "Thread-21" java.lang.ExceptionInInitializerError
         at org.eclipse.swt.widgets.Display.<clinit>(Display.java:130)
         at my.applet.SWTInBrowser.run(SWTInBrowser.java:52)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.arch.data.model read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:167)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
         at org.eclipse.swt.internal.C.<clinit>(C.java:21)
         ... 3 moreI have exported the application in a jar, and in that jar I have put the swt.jar that the application need for the displaying of the third button, swt button.
    Here is also the HTML file:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
        <title>
          Test
        </title>
      </head>
      <body>
        <p>
              <applet code="my.applet.SWTInBrowser"
                        archive="Test.jar"
                        width="1400" height="800">
              </applet>
        </p>
      </body>
    </html>Could anyone please help me solve this problem?

    This is in reply to the first post. I don't know what happened after.
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.arch.data.model read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:167)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
         at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    If you read the above trace from bottom to top, it shows none of you classes, only classes from that Eclipse library, which seems to loadLibrary() a native DLL. In order to do this, it needs to call System.getProperty( "sun.arch.data.model" ). This call is not allowed from un unsigned applet. So I guess you need to sign the applet and this problem will go away. Many other problems may follow. Just read very very carefully all the related documentation, which I did not.

  • Content Pane Problem

    Greetings!
    I'm facing two related problems in developing a Java Applet.
    My applet class extends JApplet.
    1) The current default layout of the whole window (not individual
    components) seems to be a flowLayout. I'd like to set the layout to a
    gridBagLayout, however the setLayout command does not seem to be
    understood (my compiler is eclipse, JRE 1.5.0 and JDK 5.0), so I
    cannot get the following code to work, no specific error msg
    generated:
    getContentPane.setLayout(new GridBagLayout);
    2) similar problem, cannot setBackground or setForeground of the
    overall pane.
    Please Advise, thanks.
    -Darum

    The essentials of the code in question:
    public class STMapplet extends JApplet implements ActionListener{
         getContentPane.setLayout(new GridBagLayout());
    The whole code:
    public class STMapplet extends JApplet implements ActionListener{
         //Creat Public Text Area with 10 rows, 5 columns
         JTextArea text = new JTextArea(10,20);
         //Set the contentPane (overall applett) layout
         getContentPane.setLayout(new GridBagLayout());
         //Generate image public object and set location
         Image picture;
         int imageX = 175;
         int imageY = 50;
         //frame specs, # of frames, time between frames (ms)
         int NUM_FRMS = 65;
         int MAX_FRMS = 65;
         long FRMRATE = 7;
         //Declare variables
         boolean highV = false;
         boolean lowV = false;
         boolean highI = false;
         boolean lowI = false;
         // Declare Public image URLS, will be established later during paint method
         // Use the same URLs for LILV and HIHV
         URL hVhI;
         URL hVlI;
         URL lVhI;
         //Border URLs
         URL IMGBorderTop;
         URL IMGBorderLeft;
         URL IMGBorderRight;
         URL IMGBorderBottom;
         Image BORDERTOP;
         Image BORDERLEFT;
         Image BORDERRIGHT;
         Image BORDERBOTTOM;
         //Declare Public Buttons
         JButton highVButton;
         JButton lowVButton;
         JButton highIButton;
         JButton lowIButton;
         JButton SCAN;
         * constraint construction for layout
         * addGB adds a component to the panel that has a grid bag layout
         GridBagConstraints constraints = new GridBagConstraints();
         void addGB(JPanel panel, Component component, int x, int y){
              constraints.gridx =x;
              constraints.gridy = y;
              panel.add(component, constraints);     
         * Build User Interface
         public void init()
              //Generate buttons for each of the conditions
              SCAN = new JButton("Begin Scanning");
              highVButton = new JButton("1.00");
              lowVButton = new JButton("0.07");
              highIButton = new JButton("2.00");
              lowIButton = new JButton("0.10");
              //add action detection, the action listener is this
              SCAN.addActionListener( this );
              highVButton.addActionListener( this );
              lowVButton.addActionListener( this );
              highIButton.addActionListener( this );
              lowIButton.addActionListener( this );
              //create viewing panel with gridbag layout
              JPanel panel = new JPanel(new GridBagLayout());
              //create pane for text and add to content pane
              getContentPane().add( "East", new JScrollPane (text));
              //add buttons and headers to panel and add panel to pane
              addGB(panel, new JLabel("Voltage (V)"),0,1);
              addGB(panel, new JLabel("Current (nA)"),0,4);
              addGB(panel, highVButton,0,3);
              addGB(panel, lowVButton, 0,2);
              addGB(panel, highIButton, 0,6);
              addGB(panel, lowIButton,0,5);
              addGB(panel, SCAN, 0, 0);
              getContentPane().add("West" , panel);
              //author
              text.append("@Darin Bellisario\n");
         * Display image according to buttons pressed, called with repaint()
         public void paint(Graphics g){
              //Draw Border
              //Get URLs
              try { IMGBorderTop = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderTop.jpg");} catch (Exception e){}
              try { IMGBorderRight = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderRight.jpg");} catch (Exception e){}
              try { IMGBorderLeft = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderLeft.jpg");} catch (Exception e){}
              try { IMGBorderBottom = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderBottom.jpg");} catch (Exception e){}
              // Draw
              BORDERTOP = getImage(IMGBorderTop, "IMGBorderTop.jpg");
              BORDERRIGHT = getImage(IMGBorderRight, "IMGBorderRight.jpg");
              BORDERLEFT = getImage(IMGBorderLeft, "IMGBorderleft.jpg");
              BORDERBOTTOM = getImage(IMGBorderBottom, "IMGBorderBottom.jpg");
              g.drawImage(BORDERTOP,imageX - 49, imageY - 20, this );
              g.drawImage(BORDERRIGHT,imageX + 613, imageY, this );
              g.drawImage(BORDERLEFT,imageX - 49, imageY, this );
              g.drawImage(BORDERBOTTOM,imageX, imageY + 613, this );
              //     Display Appropriate image (HIHV & LILV same image)
              if( (highV == true && highI == true) || (lowV == true && lowI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { hVhI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/LILV&HIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "LILV&HIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
              } else      if( (highV == true && lowI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { hVlI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/LIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "LIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
              } else      if( (lowV == true && highI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { lVhI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/HILV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "HILV" + i + "of" + NUM_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
         //change image based on what buttons pressed. When an action is performed, the actionlistener (this) calls actionperformed
         public void actionPerformed (ActionEvent e){
              if (e.getSource() == highVButton){
                   highV = true;
                   lowV = false;
                   text.append("Voltage on High\n");
              if (e.getSource() == lowVButton){
                   lowV = true;
                   highV = false;
                   text.append("Voltage on Low\n");
              if (e.getSource() == highIButton){
                   lowI = false;
                   highI = true;
                   text.append("Current on High\n");
              if (e.getSource() == lowIButton){
                   lowI = true;
                   highI = false;
                   text.append("Current on Low\n");
              if (e.getSource() == SCAN){
                   text.append("Scanning\n");
                   repaint();
    Many Thanks for Any Aid!
    -Darum

  • Applet does not load on app server when Free Design Layout

    Hi,
    I have to embed a an applet in a webpage of an web application. Before I go on to anything.. let me first tell you, I am using Netbeans 6.0
    As shown in the tuorial:
    [http://www.netbeans.org/kb/articles/tutorial-applets-40.html]
    1. I first made the "Applet" source say HelloApplet. java. After compiling and running it I get the HelloApplet.jar.
    2. I created a WebApplication and then from the properties -> packaging -> I "Add Project" HelloApplet.jar.
    3. Then I a webpage I "embeded" the applet.
    4. I run the web app and the applet gets loaded and everything is just fine.
    But before I go on I must tell you that the applet was designed in Null Layout. Now I edited the applet source once again and changed the layout to Free Design Layout*. ( this is available from Netbeans..on the HelloApplet.java .. go to the design view.. right click on the form and from the context menu you can change the layout to FreeDesign or whatever you might want).
    When I expand the "Libraries" node I see the that the library Swing Layout Extensions - swing-layout-1.0.3.jar has been added.
    When I "run" the "HelloApplet.java" file, the applet is shown in the appletviewer. No problems with that.
    But!
    When I try to Clean & Build and Run the WebApplication, the applet does not get loaded. On inspecting the java console I see the following error:
    java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 10 moreIt clearly shows that the Free Design Layout has something to do with the GroupLayout which can be found by expanding the "Swing Layout Extensions - swing-layout-1.0.3.jar". Now when the HelloApplet.jar is created only the HelloApplet.class file gets included together with some other data but NOT the swing extensions. Hence when I run the web app the class file looks for the GroupLayout.class definition but can find it in the jar as its not included when the HelloApplet.jar is created.
    But with null layout there isint a problem because null layout takes the definitions from the JRE on the machine.. and so it runs without a hitch.
    My Question is : How can I run the applet with Free Design Layout? or is it possible to package the swing layout extensions in the HelloApplet.jar?<</u>
    Thanks for all your replies.
    Cheers.
    Edited by: arijit_datta on May 15, 2008 4:07 PM

    Solved.
    Here is the solution:
    [http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-to17259115.html|http://www.nabble.com/Applet-does-not-load-on-app-server-when-Free-Design-Layout-to17259115.html]
    Cheers..
    Edited by: arijit_datta on May 16, 2008 7:41 AM

  • Assign keyboard layout switch hotkey not listed in the keyboard applet

    I found some old tutorial to assign left alt+shift to 1st layout and right alt+shift to 2nd layout. How to adapt it to the modern hal way?
    Here it is:
    create $XKBROOT/mysym :
    partial modifier_keys xkb_symbols "shift_ctrl_1" {
    key <LFSH> {
    type="PC_BREAK",
    symbols[Group1]= [ Shift_L, ISO_First_Group ]
    key <RTSH> {
    type ="PC_BREAK",
    symbols[Group1]= [ Shift_R, ISO_Last_Group ]
    key <LCTL> { [ Control_L, ISO_First_Group ] };
    key <RCTL> { [ Control_R, ISO_Last_Group ] };
    add 1 line to $XKBROOT/rules/xorg (after "! option    =    symbols"):
    ! option = symbols
    myshiftctrl1 = +mysym(shift_ctrl_1)
    add option to xorg.conf :
    ! option = symbols
    Section "InputDevice"
    Option "XkbOptions" "myshiftctrl1"
    EndSection

    Found a temporary solution. Unfortunately It resets other options set in the corresponding gnome applet;
    Instead of alt+shift it sets shift+alt to change layout. I tried to swap the key names in 'mysym' file, but it has no effect.
    #!/bin/sh
    xkbdir="`mktemp -d`" || exit $?
    mkdir "$xkbdir/symbols"
    cat>"$xkbdir/symbols/mysym" <<EOF
    partial modifier_keys xkb_symbols "alt_shift_1" {
    key <LALT> {
    type="PC_BREAK",
    symbols[Group1]= [ Alt_L, ISO_First_Group ]
    key <RALT> {
    type ="PC_BREAK",
    symbols[Group1]= [ Alt_R, ISO_Last_Group ]
    key <LFSH> { [ Shift_L, ISO_First_Group ] };
    key <RTSH> { [ Shift_R, ISO_Last_Group ] };
    EOF
    setxkbmap -symbols "pc+us+ru:2+inet(evdev)+mysym(alt_shift_1)" -print | xkbcomp -w0 -I -I"$xkbdir" -I/usr/share/X11/xkb - $DISPLAY && rm -rf "$xkbdir"

  • Applet not finding oracle.jdeveloper.layout.XYLayout. How to add to jar?

    hey guys, i have created an applet and it is unable to find oracle.jdeveloper.layout.XYLayout. How might I add this to my jar to be able to deploy it?

    not.
    Figure out what jar it's in, and add that jar to the classpath for the applet (and thus to the webserver in a location where the applet can load it from).
    See the documentation to figure out how to set an applet classpath.

  • Layout settings problem in Applet

    hi
    I got problem in setting up the layout in Applet for a calculator.I tried my best using GridLayout,BoxLayout etc but nothing hapened like a calculator. If any class else there with which I can do it easily please tell me..

    here is a lil demo with GridLayout and BorderLayout.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class KeyPadDemo extends Applet {
         KeyPad keyPad;
         TextArea textArea;
         public void init(){
              this.setSize(300,300);
              this.setLayout(new BorderLayout());
              this.add(textArea = new TextArea(), "North");
              this.add(keyPad = new KeyPad(textArea),"Center");
    class KeyPad extends Panel{
    MyButton buttonZero, buttonOne, buttonTwo,
    buttonThree, buttonFour, buttonFive, buttonSix;
    MyButton buttonSeven, buttonEight, buttonNine,
    buttonDecimal, buttonZeroZero;
         TextArea outputArea;
         KeyPad(TextArea outputArea){
              this.outputArea=outputArea;
    setLayout(new GridLayout(4,3));                    //GUI number
    r button pad
              add(buttonSeven = new MyButton("1"));
              add(buttonEight  = new MyButton("2"));
              add(buttonNine = new MyButton("3"));
              add(buttonFour = new MyButton("4"));
              add(buttonFive = new MyButton("5"));
              add(buttonSix = new MyButton("6"));
              add(buttonOne = new MyButton("7"));
              add(buttonTwo = new MyButton("8"));
              add(buttonThree = new MyButton("9"));
              add(buttonZero = new MyButton("0"));
              add(buttonDecimal  = new MyButton("."));
              add(buttonZeroZero = new MyButton("00"));
    class MyButton extends Button implements
    ActionListener{
              String string;
              public MyButton(String string){
                   super(string);
                   this.string=string;
                   addActionListener(this);
              public void actionPerformed(ActionEvent e){
                   outputArea.append(string);
    ===============================================================
    Thank you for writing the code. But I have done it using GridBagLayout.
    thankyou again for ur solution because I got that how to do the same thing with a different source(GridLayout,BorderLayout).

  • Bluetooth applet inactive, no kbd layout shortcut - cinnamon

    Hi,
    I'm  a new user, just installed arch + cinnamon yesterday.
    All went smooth even 1st time, fixed minor issues.
    The things can't figure are:
    bluetooth settings applet is inactive. It allows to switch BT on/off, but not add devices etc.
    Keyboard switch layout is not present anywhere. (I'm used to a nice gnome settings where one could use any key comb)
    https://dl.dropbox.com/u/20461706/scree … ge_001.png
    https://dl.dropbox.com/u/20461706/scree … th_003.png
    I've tried pure gnome desktop - same thing. Booted into live mint with cinnamon - all works great.
    Thx!

    For bluetooth to work properly you need to install the bluez package and afterwards enable/start the bluetooth service. As I've set my keyboard layout in a *.conf file in /etc/X11/xorg.conf.d/ and don't really switch the layout all that often, then I can't really help you there, but maybe the wiki pages of GNOME and Xorg will help you find what you're looking for.
    Good luck!

  • Keyboard layout indicator applet freezes in GNOME

    Hi all!
    Keyboard layout indicator applet freezes in GNOME. This means that I'm not able to switch layouts by clicking on applet and applet doesn't show current keyboard layout The only way to solve this - delete applet from The Panel and place it again.
    This strange behaviour began after latest GNOME updates.
    How can I solve this "correctly"?

    Problem dissappeared with this in xorg.conf:
        Option "XkbRules"    "xorg"
        Option "XkbModel"    "pc105"
        Option "XkbLayout"    "us,ru"
        Option "XkbVariant"    ",winkeys"
        Option "XkbOptions"    "grp:alt_shift_toggle"
    Seems that GNOME doesn't like "ru(winkeys)" in "XkbLayout"

Maybe you are looking for