• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Problem to GridBagLayout

 
HuaMin chen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How to resolve
https://1drv.ms/u/s!Ai8CrEskdewXmRtMYelenI3bgWWO

due to this line

       GridBagLayout gbl = new GridBagLayout();
 
Campbell Ritchie
Marshal
Posts: 65365
248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post full details of what is going wrong, and please also show us the code. Many people are reluctant to open that sort of link.
 
HuaMin chen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are the codes

and how to correct last line in above?
 
Paul Clapham
Sheriff
Posts: 24632
56
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HuaMin chen wrote:and how to correct last line in above?



What's wrong with it?
 
HuaMin chen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the error

GridBagLayout cannot be resolved to a type
 
Piet Souris
Saloon Keeper
Posts: 3439
149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to do an import:

and see if that helps.
 
HuaMin chen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.

How to resolve

Color cannot be resolved to a variable

to this line

       JLabel label1 = createLabel(300, 300, Color.BLUE);
 
Piet Souris
Saloon Keeper
Posts: 3439
149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you use an IDE? If so, the IDE would do (or suggest to do) the required imports for you. Otherwise, you have to imprt the Color class as well:
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!