I tend to prefer the first solution because: Note: there is also another possibility: you can skip the import and directly mention the complete class name (with the package): tLayout(new ()) JFrame frame = new JFrame() //cerates frameįtDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) //exit out of applicationįtSize(500, 500) //sets x-dimesion, and y-dimension of frame Remove the ambiguity by renaming the class you created (to FlowLayoutExample for example). The error is due to the fact the tLayout() method expects a and not a gui.FlowLayout which is the only FlowLayout available in your code. There is a potential conflict between the class you created gui.FlowLayout and, the layout you have to give to your frame.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |