Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Grouplayoutmanager with eclipse  RSS feed

 
Omer Can
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I put this question on the EASY ECLIPE FORUM, but got go reply so for.
The question also concerns the usage of Eclipse as you wil find out after reading my quest for help.
Thanks for your help in advance.

It seem that I can not use he Grouplayoutmanager with easy eclipse.

import javax.swing.GroupLayout; gives me an error.
With Eclipse I get no error-message entering code with Grouplayout, just when compiling.

Here is a simple project which I compile with eg bluej, but not with either eclipse or
easy eclipse:

package simplegrouplayout;

//public class Simplegrouplayoutcre {
//}

import javax.swing.GroupLayout; //<<<< the error-message in east eclipse starts here.
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Simplegrouplayoutcre {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);

JButton buttonD = new JButton("D");
JButton buttonR = new JButton("R");
JButton buttonY = new JButton("Y");
JButton buttonO = new JButton("O");
JButton buttonT = new JButton("T");

GroupLayout.SequentialGroup leftToRight = layout.createSequentialGroup();

leftToRight.addComponent(buttonD);
GroupLayout.ParallelGroup columnMiddle = layout.createParallelGroup();
columnMiddle.addComponent(buttonR);
columnMiddle.addComponent(buttonO);
columnMiddle.addComponent(buttonT);
leftToRight.addGroup(columnMiddle);
leftToRight.addComponent(buttonY);

GroupLayout.SequentialGroup topToBottom = layout.createSequentialGroup();
GroupLayout.ParallelGroup rowTop = layout.createParallelGroup();
rowTop.addComponent(buttonD);
rowTop.addComponent(buttonR);
rowTop.addComponent(buttonY);
topToBottom.addGroup(rowTop);
topToBottom.addComponent(buttonO);
topToBottom.addComponent(buttonT);

layout.setHorizontalGroup(leftToRight);
layout.setVerticalGroup(topToBottom);

frame.add(panel);
frame.pack();
frame.setVisible(true);
}
}

The code comes from
http://www.java2s.com/Tutorial/Java/0240__Swing/AFramewithaGroupLayout.htm

How to solve this?

Thanks
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GroupLayout was introduced in Java 1.6. Looks like you are using an old, out-of-date, end-of-life compiler. Time to update!
 
Omer Can
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Darryl Burke

I have installed JAVA 7 and was using Eclipse 3.6 (am downloadding 4.2 now) and EasyEclips 1.3.1.

I must say that developing with EasyEclipse with JAVA is easier.
But since the developers of EasyyEclipse have stopped coming up with new versions of it,
ever since 2011, this could force me to start working with Eclipse instead.

Java 1.6? As I wrote before, I have installed JAVA JDK 7 SE.
Does EastEclipse come up being installed with it own JAVA SDK (1.6)?
I can't belief that.

I would love the keep on working with EasyEclipse (being a beginner, so for now).

So, is there a way to keep on working with EasyEclipse using al the layout managers?

I will remove Eclipse 3.6 (Helios) and install 4.2 (Juno).
By doing this, I at least can keep on working with Eclipe, I hope.

Thanks

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Omer Can wrote:
Java 1.6? As I wrote before, I have installed JAVA JDK 7 SE.
Does EastEclipse come up being installed with it own JAVA SDK (1.6)?
I can't belief that.


I haven't used EasyEclipse myself. But from what I understood from http://www.easyeclipse.org/site/help/plugin-chart.html, EasyEclipse comes with the JDK.
From http://www.easyeclipse.org/site/plugins/sun-jdk-5-win32-x86.html
Changes in EasyEclipse 1.3.0:

Upgraded to Java JDK for Windows 1.5.0.12.


Regular eclipse provides you way of defining which JDK to use Preferences->Java->Installed JREs. Check if EasyEclipse has something similar which you can use to point to your system JDK7
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!