greetngs, i am trying to learn Java and Swing by writing a simple game of connect4.
i am hoping you could guide me regarding the following issue:
to emulate the connect4 grid should i use a JTable or rely on Grid layout?
thank you.
I think Grid layout would be better
alt text http://stevemcc.com/wp-content/uploads/2008/12/connect4.png
An example of grid layout: http://leepoint.net/notes-java/GUI/layouts/30gridlayout.html
You can use a JLabel to add the images.
You can create an array of JLabels and add each one to one cell of the panel. If you need to modify the picture you just modify the Jlabel picture.
Related
How to use both vertical and horizontal ScrollView in Xamarin iOS ?
I am using CollectionView but with it I only get one scrollview working at a time.
It's because it's nature of collection view, you can make it scroll in one direction at a time i.e. either horizontal or vertical. What you exactly want to achieve that you have not mentioned. if you are going to use collection view inside the scroll view, you have to manage it properly.
The best solution would be use a UICollectionView for the horizontal
scroll and the UITableView for the vertical scroll.
But if you want to make it work only using UICollectionView you have to use Subclassing UICollectionViewLayout.
here is link you can refer to make it work, hope this might help you:
1.https://www.brightec.co.uk/ideas/uicollectionview-using-horizontal-and-vertical-scrolling-sticky-rows-and-columns
2.Subclassing UICollectionView
3.UICollectionView scrolling in both directions
Hey there I have been wanting to implement a layout that is responsive and scaleable. I have been looking into the Linear Layout with the layout_weight attribute but to no success.
Could you give me a hint or point me in the right direction as one would achieve a responsive layout similar to this one in the picture?
After some intense search I found this can be achieve by a couple of ways. Either by using GridLayout or GridView or by just manipulating LinearLayout with elements inside it.
I am new to Xamarin IOS and I have a problem with creating nested layouts in IOS as like in Android(some text controls and a list view) . I added a tableview but not sure how to add some text and image controls in a view and add the tableview below the text and image controls. Also I am using ViewPager in Android and is there an equivalent control that I can use in IOS?
Yes, you should use UIScrollView and enable paggin there. The only issue that you need always to set the ContentSize for it, to make it scroll properly. So you should set the common Size of inner content.
You should check out monotouch.dialog for rapid tableview development. Once you get the hang of it, it makes creating tables a lot easier.
I would like to create a Qwidget with a large number of square QPushButtons. I would like those buttons to be organised into a mosaic layout. Whenever the window is resized, the mosaic widget should be resized and the buttons re-ordered accordingly to fill in the width. Buttons that cannot fit within the area, can be viewed by scrolling the widget vertically.
Is there a Qt4 Layout that allows me to do this easily? What is the best / easiest way to achieve this? Thanks.
You could use the flow layout (from Qt examples) inside a resizable QScrollArea.
Use a QGridLayout in a QScrollArea.
I am very new in j2me. I want to design following type layout and components.
Mean I want to arrange my items in gridview. And after clicking on each item I will move to another form.
I am using simple lcdui. Please suggest me how can I do this. Means how can I arrange these items in gridview and what items should I use here buttons or something else.
You may provide me some suitable links.
In J2ME you have two options for UI: Form and Canvas.
Forms are a very simple way to display information without dealing with the graphical side of things, where Canvas is a blank screen and you need to draw the objects and their behaviors.
There is a third way: the guys at Sun has created a framework called (LWUIT which stands for Light Weight UI Toolkit). This toolkit provides the simplicity of Forms and the UI control of Canvas.
Hope i helped.